mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-16 00:00:12 +02:00
sync: improve the docs of UnboundedSender::send (#7661)
This commit is contained in:
@@ -533,9 +533,10 @@ impl<T> UnboundedSender<T> {
|
||||
|
||||
/// Attempts to send a message on this `UnboundedSender` without blocking.
|
||||
///
|
||||
/// This method is not marked async because sending a message to an unbounded channel
|
||||
/// never requires any form of waiting. Because of this, the `send` method can be
|
||||
/// used in both synchronous and asynchronous code without problems.
|
||||
/// This method is not marked as `async` because sending a message to an unbounded channel
|
||||
/// never requires any form of waiting. This is due to the channel's infinite capacity,
|
||||
/// allowing the `send` operation to complete immediately. As a result, the `send` method can be
|
||||
/// used in both synchronous and asynchronous code without issues.
|
||||
///
|
||||
/// If the receive half of the channel is closed, either due to [`close`]
|
||||
/// being called or the [`UnboundedReceiver`] having been dropped, this
|
||||
|
||||
Reference in New Issue
Block a user