Module spsc

Module spsc 

Source
Expand description

Wait-free single-producer single-consumer (SPSC) queue to send data to another thread. Based on the improved FastForward queue.

§Example

use waitfree_sync::spsc;

//                            Type ──╮   ╭─ Capacity
let (mut tx, mut rx) = spsc::spsc::<u64>(8);
tx.try_send(234);
assert_eq!(rx.try_recv(),Some(234u64));

§Behaviour for full and empty queue.

If the queue is full the Sender returns an NoSpaceLeftError If the queue is empty the Receiver returns None

§Behaviuor on drop

Structs§

NoSpaceLeftError
Receiver
Sender

Functions§

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