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

Document how tokio::sync::broadcast::channel(0) behaves #4621

Closed
TheButlah opened this issue Apr 15, 2022 · 1 comment · Fixed by #4622
Closed

Document how tokio::sync::broadcast::channel(0) behaves #4621

TheButlah opened this issue Apr 15, 2022 · 1 comment · Fixed by #4622
Labels
A-tokio Area: The main tokio crate C-feature-request Category: A feature request. M-sync Module: tokio/sync

Comments

@TheButlah
Copy link

I'm not sure how broadcast::channel(0) would work, and if I should set my capacity to 0 or 1 if I only intend on ever sending 1 message. If the capacity is 0, does that mean the sending thread blocks until all receiving threads have received, like crossbeam_channel? https://docs.rs/crossbeam-channel/latest/crossbeam_channel/struct.Sender.html#method.send

@TheButlah TheButlah added A-tokio Area: The main tokio crate C-feature-request Category: A feature request. labels Apr 15, 2022
@Darksonn Darksonn added the M-sync Module: tokio/sync label Apr 15, 2022
@Darksonn
Copy link
Contributor

The function will panic if you specify a capacity of zero.

Feel free to submit a PR that adds that to the documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-tokio Area: The main tokio crate C-feature-request Category: A feature request. M-sync Module: tokio/sync
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants