Module nolock::queues::spsc::bounded[][src]

Expand description

This implements a bounded lock-free Queue

Example

use nolock::queues::spsc::bounded;

// Creates a new BoundedQueue with the Capacity for 5 Items
let (mut rx, mut tx) = bounded::queue(5);

// Enqueues the Value 13 on the Queue
tx.try_enqueue(13);
// Dequeues 13 from the Queue again
assert_eq!(Ok(13), rx.try_dequeue());

Reference:

Structs

An async variant of the BoundedReceiver that allows your to efficiently use this Queue in async Contexts as well.

An async variant of the BoundedSender that allows your to efficiently use this Queue in async Contexts as well.

The Receiving-Half for the Queue

The Sending-Half for the queue

The Future returned when dequeue an Item

The Future returned when enqueueing an Item

Functions

Creates an async BoundedQueue and returns its respecitive (AsyncBoundedReceiver, AsyncBoundedSender)

Creates a new Bounded-Queue with the given Capacity and returns the corresponding Handles (BoundedReceiver, BoundedSender)