[−][src]Function futures_intrusive::channel::shared::generic_channel
pub fn generic_channel<MutexType, T, A>(
capacity: usize
) -> (GenericSender<MutexType, T, A>, GenericReceiver<MutexType, T, A>) where
MutexType: RawMutex,
A: RingBuf<Item = T>,
T: Send,
Creates a new Channel which can be used to exchange values of type T
between
concurrent tasks. The ends of the Channel are represented through
the returned Sender and Receiver.
Both the Sender and Receiver can be cloned in order to let more tasks
interact with the Channel.
As soon es either all Senders or all Receivers are closed, the Channel itself will be closed.
The channel can buffer up to capacity
items internally.
let (sender, receiver) = channel::<i32>(4);