What is the difference between `channelFlow` and `...
# coroutines
s
What is the difference between
channelFlow
and
callbackFlow
? Both have the same signature except latter is
inline
. Is this the only difference?
d
They even have the same implementation.
You supposed to use
callbackFlow
for setup up a flow wrapper for callback-based listeners and such.
s
And why am I supposed to use
callbackFlow
in this case and not
channelFlow
? 😉
d
And use
channelFlow
when you find yourself needing concurrent
emit
.
👍 1
s
Yeah, it seems the names are different based on intent, not on implementation 😀
s
So both functions are interchangeable regardless of the use case?
👌 1
d
Pretty much.