-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
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.
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
WeakSender
to thesync::broadcast::channel
similar tosync::maps::channel
.Solution
The new
WeakSender
type just stores anArc<Shared<T>>
just like the normalSender
but activeWeakSenders
will not prevent the channel from being closed if allSender
s are dropped.Closes #7003.