Why is there no `io.reactivex.Observable.asFlow`?
# coroutines
p
Why is there no
io.reactivex.Observable.asFlow
?
v
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
And flowable supports backpressure?
v
yes
p
Sorry I meant flow. Does flow support back pressure?
z
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.