[][src]Function multiqueue2::broadcast_queue_with

pub fn broadcast_queue_with<T: Clone, W: Wait + 'static>(
    capacity: u64,
    wait: W
) -> (BroadcastSender<T>, BroadcastReceiver<T>)

Creates a (BroadcastSender, BroadcastReceiver) pair with a capacity that's the next power of two >= the given capacity and the specified wait strategy

Example

use multiqueue2::broadcast_queue_with;
use multiqueue2::wait::BusyWait;
let (w, r) = broadcast_queue_with(10, BusyWait::new());
w.try_send(10).unwrap();
assert_eq!(10, r.try_recv().unwrap());