[][src]Function futures_intrusive::channel::shared::generic_channel

pub fn generic_channel<MutexType, T>(
    capacity: usize
) -> (GenericSender<MutexType, T>, GenericReceiver<MutexType, T>) where
    MutexType: RawMutex,
    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);