Skip to content

Commit 1a4cf31

Browse files
sync: improve the docs of UnboundedSender::send (#7661)
1 parent 3698a6f commit 1a4cf31

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

tokio/src/sync/mpsc/unbounded.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -533,9 +533,10 @@ impl<T> UnboundedSender<T> {
533533

534534
/// Attempts to send a message on this `UnboundedSender` without blocking.
535535
///
536-
/// This method is not marked async because sending a message to an unbounded channel
537-
/// never requires any form of waiting. Because of this, the `send` method can be
538-
/// used in both synchronous and asynchronous code without problems.
536+
/// This method is not marked as `async` because sending a message to an unbounded channel
537+
/// never requires any form of waiting. This is due to the channel's infinite capacity,
538+
/// allowing the `send` operation to complete immediately. As a result, the `send` method can be
539+
/// used in both synchronous and asynchronous code without issues.
539540
///
540541
/// If the receive half of the channel is closed, either due to [`close`]
541542
/// being called or the [`UnboundedReceiver`] having been dropped, this

0 commit comments

Comments
 (0)