Slide 28
Slide 28 text
What’s special
✨ Null safety in streams
✨ Interoperability between other reactive streams and
coroutines
✨ Supports Kotlin multiplatform
✨ No special handling for back pressure
✨ Fewer and simple operators
✨ Perks of structured concurrency
• Flow provides null safety in the stream that means you cannot send null values in the stream, this is not something new; RxJava 2 has it too
• This is the key thing, Flow provides easy APIs to convert Flow to any other reactive stream like RxJava Flowable and the reverse. Also you can combine Flow and
coroutines, we will see this later
• You can actually use Kotlin coroutines and Flow on any of the supported Kotlin platforms like JVM, JS and native + use it the common code or shared code for Kotlin
multiplatform projects
• There is no special handling for back pressure, there are literally no operators for handling back pressure cause this is magically handled by the suspending nature of
coroutines
• There are fewer operators which directly correlates to ease of understanding, this is because of 2 reasons
• Kotlin’s extension function magic
• Suspending nature of coroutines allow having same operator for synchronous / asynchronous code which cuts down the number of operators
•