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

sync: Added WeakSender to sync::broadcast::channel #7100

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tglane
Copy link
Contributor

@tglane tglane commented Jan 14, 2025

Motivation

Closing issue #7003. Add a type WeakSender to the sync::broadcast::channel similar to sync::maps::channel.

Solution

The new WeakSender type just stores an Arc<Shared<T>> just like the normal Sender but active WeakSenders will not prevent the channel from being closed if all Senders are dropped.

Closes #7003.

@github-actions github-actions bot added the R-loom-sync Run loom sync tests on this PR label Jan 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
R-loom-sync Run loom sync tests on this PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add WeakSender for tokio::sync::broadcast
1 participant