Published : Apr 13, 2021
NOT ON THE CURRENT EDITION
This blip is not on the current edition of the Radar. If it was on one of the last few editions, it is likely that it is still relevant. If the blip is older, it might no longer be relevant and our assessment might be different today. Unfortunately, we simply don't have the bandwidth to continuously review blips from previous editions of the Radar.
Understand more
Apr 2021
Trial
The introduction of coroutines to Kotlin opened the door for several innovations — Kotlin Flow is one of them, directly integrated into the coroutines library. It's an implementation of Reactive Streams on top of coroutines. Unlike RxJava, flows are a native Kotlin API similar to the familiar sequence API with methods that include map
and filter
. Like sequences, flows are cold, meaning that the values of the sequence are only constructed when needed. All of this makes writing multithreaded code much simpler and easier to understand than other approaches. The toList
method, predictably, converts a flow into a list which is a common pattern in tests.