Skip to main content

channel

Function channel 

Source
pub fn channel<T>() -> (Sender<T>, Receiver<T>)
Expand description

Creates a new oneshot channel, returning the sender/receiver halves.

The Sender is used by the producer to send the value. The Receiver handle is used by the consumer to receive the value.

send will no block the calling thread. recv will block until a message is available.