https://kotlinlang.org logo
#rx
Title
# rx
m

Mohamed Ibrahim

06/02/2019, 3:10 PM
Could anyone tell us the difference between the Kotlin Flow api and Rxjava, is it a Kotlin implementation for the reactive extension or is it a different thing
k

kioba

06/02/2019, 4:42 PM
Flow is a coroutines based cold asynchronous stream solution just as reactive streams. You can interop with RxJava2.
As far as I know there are a few operators implemented for Flow but not the whole reactive extensions specification
g

gildor

06/02/2019, 5:02 PM
Flow isn’t implement reactive extension interfaces, but provides reactive extensions adapter
👍 1
j

jw

06/02/2019, 6:02 PM
...which is what RxJava should have done and technically does
👍 1
m

Mohamed Ibrahim

06/03/2019, 3:22 PM
if I understands that clearly .. in Flow items will not be emitted unless there is a consumer .. but it also it hasn't the full RX interfaces .. but to maintain playing well with Rx there is an Adapter to be able to switching between flow and Rxjava for example
g

gildor

06/03/2019, 4:03 PM
in Flow items will not be emitted unless there is a consumer
Yes, but same as Rx
but to maintain playing well with Rx
It's kinda abstract, adapter is just a function that creates Rx types or allows to convert Rx abstractions to coroutines
m

Mohamed Ibrahim

06/03/2019, 5:22 PM
cool, I got it now
3 Views