Function clocked_dispatch::new [] [src]

pub fn new<T: Clone + Send + 'static>(bound: usize) -> Dispatcher<T>

Creates a new clocked dispatch. Dispatch channels can be constructed by calling new on the returned dispatcher.

The dispatcher has an internal buffer for incoming messages. When this buffer becomes full, future sends to the dispatcher will block waiting for the buffer to open up. Note that a buffer size of 0 is valid, but its behavior differs from that of synchronous Rust channels. Because the dispatcher sits between the sender and the receiver, a bound of 0 will not guarantee a "rendezvous" between the sender and the receiver, but rather between the sender and the dispatcher (and subsequently, the dispatcher and the receiver).

Be aware that a bound of 0 means that it is not safe to drop a ClockedSender before the corresponding ClockedReceiver is reading from its end of the channel.