`channel.consumeEach { …. } `. The rest of the cod...
# coroutines
e
channel.consumeEach { …. }
. The rest of the code will execute only when the channel is closed
j
I mean without consuming the elements
e
No, unless it is a
BroadcastChannel
.
j
Ah interesting. Thanks
e
But you can also have consumer to send a special signal to whomever is interested (via another channel, for example)
j
yes indeed. That's what I was doing before. I just wonderd if I could simplify it