CompletableWrapper

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

Constructors

Link copied to clipboard
constructor(inner: Completable)

Functions

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
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

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
open override fun subscribe(observer: CompletableObserver)

Subscribes the specified Observer to this Source

fun subscribe(onComplete: () -> Unit): Disposable
fun subscribe(onError: (Throwable) -> Unit, onComplete: () -> Unit): Disposable
fun subscribe(onSubscribe: (Disposable) -> Unit? = null, onError: (Throwable) -> Unit? = null, onComplete: () -> Unit? = null): Disposable
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