Function kitsune_p2p_types::tx2::tx2_utils::t_chan[][src]

pub fn t_chan<T: 'static + Send>(bound: usize) -> (TSender<T>, TReceiver<T>)
Expand description

tokio::sync::mpsc::Sender is cheaply clonable, futures::channel::mpsc::Sender can be closed from the sender side. We want both these things. Produce a TChan - a wrapper around a tokio::sync::mpsc::channel. Provides futures::stream::Stream impl on TReceive. Allows channel close from sender side.