Open Marenz opened 4 months ago
There is usually a way to stop receiving data from a channel, by stopping the channel, but I think this issue is about stopping a single receiver, not shutting down a whole channel, so I updated the subject.
BTW, the logging of overflow only applies to Broadcast
channels, Anycast
doesn't have a per-receiver buffer so there are no warnings, at least at the receiver level.
In any case I think a stop()
and a async context manager interface would be a good addition for Receiver
in general.
If you stop reading from a channel, you will get an overflow warning message after a short while.
Sometimes, however we want to properly stop and not get spammed with log warnings, so a convenient and explicit way to do that would be nice.