Skip to main content

channel

Function channel 

Source
pub fn channel<T>(buffer_size: usize) -> (Producer<T>, Consumer<T>)
Expand description

Creates a new channel with the specified buffer size.

Returns a (Producer, Consumer) pair. The channel starts in SPSC mode and automatically upgrades to MPSC when the producer is cloned.