Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A way to explicitly stop a Receiver #297

Open
Marenz opened this issue May 15, 2024 · 1 comment
Open

A way to explicitly stop a Receiver #297

Marenz opened this issue May 15, 2024 · 1 comment
Labels
part:core Affects the core types (`Sender`, `Receiver`, exceptions, etc.) priority:❓ We need to figure out how soon this should be addressed type:enhancement New feature or enhancement visitble to users
Milestone

Comments

@Marenz
Copy link
Contributor

Marenz commented May 15, 2024

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.

@Marenz Marenz added part:❓ We need to figure out which part is affected priority:❓ We need to figure out how soon this should be addressed type:enhancement New feature or enhancement visitble to users labels May 15, 2024
@llucax llucax added part:core Affects the core types (`Sender`, `Receiver`, exceptions, etc.) and removed part:❓ We need to figure out which part is affected labels May 15, 2024
@llucax llucax changed the title A way to explicitly stop receiving data from a channel A way to explicitly stop a Receiver May 15, 2024
@llucax
Copy link
Contributor

llucax commented May 15, 2024

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.

@llucax llucax added this to the Untriaged milestone May 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
part:core Affects the core types (`Sender`, `Receiver`, exceptions, etc.) priority:❓ We need to figure out how soon this should be addressed type:enhancement New feature or enhancement visitble to users
Projects
None yet
Development

No branches or pull requests

2 participants