Can anyone help me understand the use case differe...
# coroutines
z
Can anyone help me understand the use case difference for a
callbackFlow
and a
Channel
? both seem to support "hot" streams
l
The former has the latter, but it's auto-closed on cancellation of the flow collector.
As explained in their respective docs in more details.
z
Channel is a synchronization primitive for communicating between coroutines. CallbackFlow is basically just shorthand for creating a channel, then launching a coroutine to send to the channel, and returning a Flow that reads from the channel.
z
much appreciated!