Utilities for RxJava 2.x.

Coroutine builders:

Name Result Scope Description
rxCompletable Completable CoroutineScope Cold completable that starts coroutine on subscribe
rxMaybe Maybe CoroutineScope Cold maybe that starts coroutine on subscribe
rxSingle Single CoroutineScope Cold single that starts coroutine on subscribe
rxObservable Observable ProducerScope Cold observable that starts coroutine on subscribe
rxFlowable Flowable ProducerScope Cold observable that starts coroutine on subscribe with backpressure support

Suspending extension functions and suspending iteration:

Name Description
CompletableSource.await Awaits for completion of the completable value
MaybeSource.await Awaits for the value of the maybe and returns it or null
MaybeSource.awaitOrDefault Awaits for the value of the maybe and returns it or default
MaybeSource.openSubscription Subscribes to maybe and returns ReceiveChannel
SingleSource.await Awaits for completion of the single value and returns it
ObservableSource.awaitFirst Awaits for the first value from the given observable
ObservableSource.awaitFirstOrDefault Awaits for the first value from the given observable or default
ObservableSource.awaitFirstOrElse Awaits for the first value from the given observable or default from a function
ObservableSource.awaitFirstOrNull Awaits for the first value from the given observable or null
ObservableSource.awaitLast Awaits for the last value from the given observable
ObservableSource.awaitSingle Awaits for the single value from the given observable
ObservableSource.openSubscription Subscribes to observable and returns ReceiveChannel
ObservableSource.iterator Subscribes to observable and returns ChannelIterator

Note, that Flowable is a subclass of Reactive Streams Publisher and extensions for it are covered by kotlinx-coroutines-reactive module.

Conversion functions:

Name Description
Job.asCompletable Converts job to hot completable
Deferred.asSingle Converts deferred value to hot single
ReceiveChannel.asObservable Converts streaming channel to hot observable
Scheduler.asCoroutineDispatcher Converts scheduler to CoroutineDispatcher

Packages

kotlinx.coroutines.experimental.rx2

Utilities for RxJava 2.x.

Index

All Types