What's the difference between ``` flow<String&g...
# coroutines
t
What's the difference between
Copy code
flow<String> {
    emit("Foo")
}
and
Copy code
channelFlow<String> {
    send("Foo")
}
Apart from the receiver, that is
FlowCollector
in the first and
ProducerScope
in the second.
j
A
channelFlow
allows you to
send
from any thread/context. A
flow
can only emit on the same context.
💯 3
s
I thought is was even more ‘strict’: A
flow
can only emit on the same scope (coroutine-scope).
👍 1