is there a way to close a channel and drop not yet...
# coroutines
m
is there a way to close a channel and drop not yet consumed elements?
b
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
that's a good idea, thanks!