https://kotlinlang.org logo
#coroutines
Title
# coroutines
p

Paul Woitaschek

04/13/2019, 12:11 PM
Why is there no
io.reactivex.Observable.asFlow
?
v

Vsevolod Tolstopyatov [JB]

04/13/2019, 12:21 PM
Observable doesn’t support backpressure. Thus in order to support
asFlow
, coroutine-specific
BackpressureStrategy
should be introduced (similar to https://projectreactor.io/docs/adapter/release/api/reactor/adapter/rxjava/RxJava2Adapter.html#observableToFlux-io.reactivex.Observable-io.reactivex.BackpressureStrategy-), properly explained and documented. I am not sure it worths it
p

Paul Woitaschek

04/13/2019, 12:34 PM
And flowable supports backpressure?
v

Vsevolod Tolstopyatov [JB]

04/13/2019, 1:07 PM
yes
p

Paul Woitaschek

04/13/2019, 1:59 PM
Sorry I meant flow. Does flow support back pressure?
z

Zach Klippenstein (he/him) [MOD]

04/13/2019, 4:40 PM
It does, through suspension. If a downstream call to
emit
suspends, all the
emit
calls upstream will also suspend, so nothing else can be emitted.
7 Views