But that never gets executed cause the consumeEach...
# coroutines
a
But that never gets executed cause the consumeEach never breaks
d
consumeEach will cancel coroutine after last element is received by throwing an exception
Use
for (item in channel)
instead
a
When does that for loop exit?
d
When the channel is closed for receive.
a
Thats not very helpful
I know the basics
I m talking about a real use case
There are 4 files - if i close the channel how will the other files write their part to it
d
What I understood is that code following your
consumeEach
is not getting executed. This would solve that problem. I'm not suggesting anything else.
a
Consume each is not exiting
Exiting
Like execute the code after it
d
I dont have near enough information to answer your question then, so if you know the basics like you say I'm sure you can figure it out with a bit of debugging