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.
trySendto send data
It looks like it is more powerful than flow. I wonder
- if there's anything where
flowcan do but not inchannelFlow, or - if there's anything
flowis 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?