You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
#7003 has added WeakSender to tokio::sync::broadcast but there is no WeakReceiver.
We have a use-case where we use a broadcast channel to pass around data to consumers while waiting for Sender::close to resolve so that we kill the processing once there is no one interested in any new data.
We now want to add one special consumer that always exists as long as the Sender exists, but we don't want it to prevent the producing task from exiting.
Describe the solution you'd like
Add tokio::sync::broadcast::WeakReceiver that does not count towards RAII, symetrical to WeakSender.
Describe alternatives you've considered
To not use Sender::close and instead manually track number of receivers.
To use multiple channels, one for "Strong" subscribers, one for "Weak" ones.
Additional context
This could also make sense for watch, the other channels only ever have a single receiver.
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
#7003 has added
WeakSender
totokio::sync::broadcast
but there is noWeakReceiver
.We have a use-case where we use a broadcast channel to pass around data to consumers while waiting for
Sender::close
to resolve so that we kill the processing once there is no one interested in any new data.We now want to add one special consumer that always exists as long as the
Sender
exists, but we don't want it to prevent the producing task from exiting.Describe the solution you'd like
Add
tokio::sync::broadcast::WeakReceiver
that does not count towards RAII, symetrical toWeakSender
.Describe alternatives you've considered
Sender::close
and instead manually track number of receivers.Additional context
This could also make sense for
watch
, the other channels only ever have a single receiver.The text was updated successfully, but these errors were encountered: