spsc

Function spsc 

Source
pub fn spsc<T>(capacity: usize) -> (Sender<T>, Receiver<T>)
Expand description

Create a new wait-free SPSC queue. The capacity must be a power of two, which is validate during runtime.

§Panic

Panics if the capacity is not a power of two.

§Example

use waitfree_sync::spsc;

//               Data type ──╮   ╭─ Capacity
let (tx, rx) = spsc::spsc::<u64>(8);