Package kotlinx.coroutines.experimental.rx1

Utilities for RxJava 1.x.

Types

SchedulerCoroutineDispatcher

class SchedulerCoroutineDispatcher : 
    CoroutineDispatcher,
    Delay

Implements CoroutineDispatcher on top of an arbitrary Scheduler.

Extensions for External Classes

kotlinx.coroutines.experimental.Deferred

kotlinx.coroutines.experimental.Job

kotlinx.coroutines.experimental.channels.ReceiveChannel

rx.Completable

rx.Observable

rx.Scheduler

rx.Single

Functions

rxCompletable

fun rxCompletable(
    context: CoroutineContext = DefaultDispatcher,
    parent: Job? = null,
    block: suspend CoroutineScope.() -> Unit
): Completable

Creates cold Completable that runs a given block in a coroutine. Every time the returned completable is subscribed, it starts a new coroutine. Unsubscribing cancels running coroutine.

rxObservable

fun <T> rxObservable(
    context: CoroutineContext = DefaultDispatcher,
    parent: Job? = null,
    block: suspend ProducerScope<T>.() -> Unit
): Observable<T>

Creates cold Observable that runs a given block in a coroutine. Every time the returned observable is subscribed, it starts a new coroutine. Coroutine emits items with send. Unsubscribing cancels running coroutine.

rxSingle

fun <T> rxSingle(
    context: CoroutineContext = DefaultDispatcher,
    parent: Job? = null,
    block: suspend CoroutineScope.() -> T
): Single<T>

Creates cold Single that runs a given block in a coroutine. Every time the returned single is subscribed, it starts a new coroutine. Coroutine returns a single value. Unsubscribing cancels running coroutine.