Channel::send
pub fn send(T value) -> Result<unit, ChannelError> Import
Source: use task::{Channel}; compiler/src/prelude/task.hy Adds value to the channel, waiting while it is full (a suspension point).
Called on a Channel value as value.send(…).
Parameters#
| Name | Type |
|---|---|
value | T |
Returns#
Result<unit, ChannelError>
Errors#
Err(ChannelError::Closed) once the channel is closed.
See also#
Channel: A bounded queue for passing values between tasks.Channel::try_send: Addsvalueif there is room, without waiting.Channel::recv: Takes the oldest value, waiting while the channel is empty (a suspension point).Channel::try_recv: Takes the oldest value if there is one, without waiting.Channel::close: Closes the channel: no more values can be sent.Channel::len: Returns the number of values waiting to be received.Channel::capacity: Returns the most values the channel can hold.Channel::is_closed: Returnstrueonceclosehas been called.