Expand description
Multi-producer, multi-consumer FIFO queue communication primitives.
This module provides message-based communication over channels, concretely defined among two types:
A Sender
is used to send data to a Receiver
. Both
sender and receiver are clone-able (multi-producer) such that many threads
can send simultaneously to multiple receiver (multi-consumer).
Disconnection
The send and receive operations on channels will all return a [Result
]
indicating whether the operation succeeded or not. An unsuccessful operation
is normally indicative of the other half of a channel having “hung up” by
being dropped in its corresponding thread.
Once half of a channel has been deallocated, most operations can no longer
continue to make progress, so [Err
] will be returned. Many applications
will continue to unwrap
the results returned from this module,
instigating a propagation of failure among threads if one unexpectedly dies.
Structs
channel
type.
This half can only be owned by one thread, but it can be cloned to receive
to other threads.Sender::send
function on channels.channel
type. This half can only be owned by one
thread, but it can be cloned to send to other threads.Enums
try_send
method.