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

solidogen

11/18/2020, 12:20 PM
I have a ArrayBroadcastChannel, which I subscribe to like channel.asFlow().launchIn(scope) between launchIn <-> flow.onStart is about 100-150ms so all items I emit in those 150ms are lost can I subscribe to this channel in some blocking way, so every emit after launchIn would be collected? I’m currently tied to coroutines 1.3.9 because of other dependencies, also Conflated channel is redundant in my case
e

elizarov

11/18/2020, 12:38 PM
Don't use broadcast channel. Use a regular channel. It guarantees that nothing is lost.
2
s

solidogen

11/18/2020, 12:43 PM
thank you, works like a charm
z

zsperske

11/18/2020, 3:56 PM
great read! let me also say not only do these new
SharedFlow
and
StateFlow
constructs work better, they are also named way better! much more intuitive
3 Views