Skip to content
Branch: master
Find file History
elizarov Change default request size in Publisher.openSubscription to one
This makes Publisher.collect consistent with Publisher.asFlow and
ensures smooth integration with reactive backpressure operators
"out of the box".

Fixes #1267
Latest commit 9420df3 Jun 18, 2019

README.md

Module kotlinx-coroutines-rx2

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

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

Package kotlinx.coroutines.rx2

Utilities for RxJava 2.x.

You can’t perform that action at this time.