-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
sync: Added WeakSender to sync::broadcast::channel
#7100
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
Conversation
* Changed memory orderings of `num_weak_tx`: Increments happen with relaxed, decrements happen with acqrel and checks for zero happen with acquire. * Add asserts for `sync::broadcast::WeakSender` to `tests/async_send_sync.rs`
…ade` and improved markdown docs.
Darksonn
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks.
|
Just want to say as the original requester of this feature THANK YOU! Frankly awesome to see how quickly this feature request was supported, y'all rock! |
I'm always looking for some issues I can work on after work to help out. Great to help you with this one :) |
Motivation
Closing issue #7003. Add a type
WeakSenderto thesync::broadcast::channelsimilar tosync::maps::channel.Solution
The new
WeakSendertype just stores anArc<Shared<T>>just like the normalSenderbut activeWeakSenderswill not prevent the channel from being closed if allSenders are dropped.Closes #7003.