https://kotlinlang.org logo
#coroutines
Title
# coroutines
m

Maciek

08/31/2020, 12:02 PM
is there a way to close a channel and drop not yet consumed elements?
b

bezrukov

08/31/2020, 12:56 PM
I would say you need to use backpressure (channel.send, instead of offer) in your producer job, and when you want to close a channel, you will cancel job and close channel.
and you need to use
RENDEZVOUS
channel to achieve this.
m

Maciek

08/31/2020, 12:58 PM
that's a good idea, thanks!
4 Views