If I open a Flow inside a Channel this will block ...
# coroutines
c
If I open a Flow inside a Channel this will block the channel for new events? or the flow will be existing in another thread/context?
z
What do you mean by “inside a Channel”?
c
I have a channel running where I threat my events. If one of this events open a Flow this would block my channel to receive new events? I could explain my self? if not let me know 🤔
z
Not sure what you mean by running. A channel is a queue, it doesn't have the concept of running. Do you mean a coroutine created with
produce
?
c
I normally use the channel with an loop inside for events this keep checking for events in the cue, So this loop keep running/executing Indeed, the channel coroutine is created by
produce
or
launch
z
If you have a loop like this:
Copy code
for (value in channel) {
  flow.collect { … }
}
Then you won’t receive the next item from the channel until the flow completes. If something is sent to the channel, then it will be buffered according to the channel’s capacity, or suspend.
👍🏾 3
👏 1
c
Thanks @Zach Klippenstein (he/him) [MOD] this was my doubt =D