Package-level declarations

Types

Link copied to clipboard

Represents a Source that either completes or produces an error.

Link copied to clipboard

Callbacks for Completable source. See Completable, CompleteCallback and ErrorCallback for more information.

Link copied to clipboard

Represents an emitter for Completable source. See Emitter and CompletableCallbacks for more information.

Link copied to clipboard

Represents an Observer of Completable source. See Observer and CompletableCallbacks for more information.

Link copied to clipboard

Wrappers are normally exposed to Swift. You can also extend the wrapper class if you need to expose any additional operators.

Functions

Link copied to clipboard
fun amb(vararg sources: Completable): Completable
Link copied to clipboard

Runs multiple Completables and signals the events of the first one to terminate (disposing the rest).

Link copied to clipboard

Returns a Completable that first runs this Completable and waits for its completion, then runs the other Completable.

fun <T> Completable.andThen(maybe: Maybe<T>): Maybe<T>

Returns an Observable that first runs this Completable and waits for its completion, then runs the other Maybe.

fun <T> Completable.andThen(observable: Observable<T>): Observable<T>

Returns an Observable that first runs this Completable and waits for its completion, then runs the other Observable.

fun <T> Completable.andThen(single: Single<T>): Single<T>

Returns a Single that first runs this Completable and waits for its completion, then runs the other Single.

Link copied to clipboard

Converts this Completable into a Maybe.

Link copied to clipboard
Link copied to clipboard
fun <T> Completable.asSingle(defaultValue: T): Single<T>

Converts this Completable into a Single which emits the defaultValue when this Completable completes.

fun <T> Completable.asSingle(defaultValueSupplier: () -> T): Single<T>

Converts this Completable into a Single which emits a value returned by defaultValueSupplier when this Completable completes.

Link copied to clipboard

Blocks current thread until the current Completable completes or fails with an exception (which is propagated). ⚠️ Please note that this method is not available in JavaScript due to its single threaded nature. A runtime exception will be thrown when this method is called in JavaScript. If you need this in JavaScript for testing purposes, then consider using Single.testAwait() extension from the reaktive-testing module.

Link copied to clipboard
inline fun completable(crossinline onSubscribe: (emitter: CompletableEmitter) -> Unit): Completable

Creates a Completable with manual signalling via CompletableEmitter.

Link copied to clipboard

Calls the supplier for each new observer and subscribes to the returned Completable.

Link copied to clipboard

Returns a Completable that calls the func shared function and then completes.

Link copied to clipboard

Returns a Completable that signals onComplete.

Link copied to clipboard

Returns a Completable that signals the specified error via onError.

Link copied to clipboard

Returns a Completable that never terminates.

Link copied to clipboard

Signals onComplete after the given delay.

Link copied to clipboard
inline fun completableUnsafe(crossinline onSubscribe: (observer: CompletableObserver) -> Unit): Completable

⚠️ Advanced use only: creates an instance of Completable without any safeguards by calling onSubscribe with a CompletableObserver.

Link copied to clipboard
fun <R> completableUsing(resourceSupplier: () -> R, resourceCleanup: (resource: R) -> Unit, eager: Boolean = true, sourceSupplier: (resource: R) -> Completable): Completable

Returns a Completable that for each subscription acquires a new resource via resourceSupplier, then calls sourceSupplier and subscribes to the returned upstream Completable and disposes the resource via sourceSupplier when the upstream Completable is finished (either terminated or disposed).

Link copied to clipboard
fun concat(vararg sources: Completable): Completable

Concatenates multiple Completable sources one by one into a Completable.

Link copied to clipboard

Concatenates multiple Completable sources one by one into a Completable.

Link copied to clipboard
fun Completable.delay(delay: Duration, scheduler: Scheduler, delayError: Boolean = false): Completable

Delays onComplete signal from the current Completable for the specified time. The onError signal is not delayed by default, which can be enabled by setting the delayError flag.

Link copied to clipboard

Delays the actual subscription to the Completable for the specified time.

Link copied to clipboard

Calls the action when the Completable signals onComplete. The action is called after the observer is called.

Link copied to clipboard

Calls the shared action when the Disposable sent to the observer via onSubscribe is disposed. The action is called after the upstream is disposed.

Link copied to clipboard

Calls the consumer with the emitted Throwable when the Completable signals onError. The consumer is called after the observer is called.

Link copied to clipboard

Calls the action when one of the following events occur:

Link copied to clipboard

Calls the shared action for each new observer with the Disposable sent to the downstream. The action is called for each new observer after its onSubscribe callback is called.

Link copied to clipboard

Calls the action when the Completable signals a terminal event: either onComplete or onError. The action is called after the observer is called.

Link copied to clipboard

Calls the action with the emitted value when the Completable signals onComplete. The action is called before the observer is called.

Link copied to clipboard

Calls the shared action when the Disposable sent to the observer via onSubscribe is disposed. The action is called before the upstream is disposed.

Link copied to clipboard

Calls the consumer with the emitted Throwable when the Completable signals onError. The consumer is called before the observer is called.

Link copied to clipboard

Calls the action when one of the following events occur:

Link copied to clipboard

Calls the shared action for each new observer with the Disposable sent to the downstream. The action is called for each new observer before its onSubscribe callback is called.

Link copied to clipboard

Calls the action when the Completable signals a terminal event: either onComplete or onError. The action is called before the observer is called.

Link copied to clipboard
fun merge(vararg sources: Completable): Completable

Merges multiple Completables into one Completable, running all Completables simultaneously.

Link copied to clipboard

Merges multiple Completables into one Completable, running all Completables simultaneously.

Link copied to clipboard

Signals all events of the Completable on the specified Scheduler.

Link copied to clipboard

Returns a Completable which completes when this Completable signals onError.

Link copied to clipboard

When the Completable signals onError, resumes the flow with next Completable.

When the Completable signals onError, resumes the flow with a new Completable returned by nextSupplier.

Link copied to clipboard
fun Completable.repeat(times: Long = Long.MAX_VALUE): Completable

When the Completable signals onComplete, re-subscribes to the Completable, times times.

Link copied to clipboard
fun <T> Completable.repeatUntil(predicate: () -> Boolean): Completable

When the Completable signals onComplete, re-subscribes to the Completable if the predicate function returns false.

Link copied to clipboard
fun Completable.repeatWhen(handler: (attempt: Int) -> Maybe<*>): Completable

When the Completable signals onComplete, re-subscribes to the Completable when the Maybe returned by the handler function emits a value.

Link copied to clipboard
fun Completable.retry(predicate: (attempt: Long, Throwable) -> Boolean = { _, _ -> true }): Completable

When the Completable signals onError, re-subscribes to the Completable if the predicate returns true.

When the Completable signals onError, re-subscribes to the Completable, up to times times.

Link copied to clipboard

Returns a Completable that automatically resubscribes to this Completable if it signals onError and the Observable returned by the handler function emits a value for that specific Throwable.

Link copied to clipboard
Link copied to clipboard
fun Completable.subscribe(onSubscribe: (Disposable) -> Unit? = null, onError: (Throwable) -> Unit? = null, onComplete: () -> Unit? = null): Disposable

Subscribes to the Completable and provides event callbacks.

Link copied to clipboard

Returns a Completable that subscribes to the source Completable on the specified Scheduler.

Link copied to clipboard
fun Completable.timeout(timeout: Duration, scheduler: Scheduler, other: Completable? = null): Completable

Disposes the current Completable if it does not signal within the timeout, and subscribes to other if provided.

Link copied to clipboard

A convenience extensions function for completableOfError.

Link copied to clipboard