A multi-producer, single-consumer queue for sending requests across asynchronous tasks.
Channel creation provides
Sender can make requests that
await a response from the
Receiver. Every message sent across the channel is packaged with
Responder that is used to respond to that request. A
Sender will wait until a response is
Sender handles have been dropped, it is no longer possible to send requests into the
channel. As such,
Receiver::receive will return an error.
Receiver is dropped, it is possible for there to be messages in the channel that will
never be processed. If a clean shutdown is desired, a receiver can first call
to prevent further messages from being sent into the channel. Then, the receiver can handle all
messages in the channel and be dropped.
- The responding end of a channel.
- Responds to a single request with a value.
- The requesting end of a channel.
- Create a new asynchronous channel with a bounded capacity, returning the sender/receiver halves.