Add .len()
method to UnboundedSender
#7077
Labels
A-tokio
Area: The main tokio crate
C-feature-request
Category: A feature request.
M-sync
Module: tokio/sync
Is your feature request related to a problem? Please describe.
The number of buffered messages can be derived from a bounded mpsc channel sender with
len = tx.max_capacity() - tx.capacity()
. However there's no methods available to get the number of buffered messages from an unbounded mpsc channel sender.Describe the solution you'd like
A
UnboundedSender::len()
method which returns how many messages are buffered in the channel and pending to be received.The text was updated successfully, but these errors were encountered: