We know that channelFlow
can do what flow
can't e.g.
- Retrieve value from a concurrently run coroutine
- Can use a non-suspending way i.e.
trySend
to send data
It looks like it is more powerful than flow
. I wonder
- if there's anything where
flow
can do but not inchannelFlow
, or - if there's anything
flow
is preferred overchannelFlow
(e.g. in terms of efficiency or performance?)?
The reason I ask is, I want to see if we can just use channelFlow
for everything instead, or what's the scenario we should use flow
instead?