Struct canal::mpmc::LockFreeQueue [] [src]

pub struct LockFreeQueue<T> {
    // some fields omitted
}

A lock-free queue that is thread-safe for multiple producers and multiple consumers.

This queue is implemented as a bounded ring buffer and thus must be initialized with a size at creation.

Methods

impl<T> LockFreeQueue<T>

fn with_capacity(capacity: usize) -> LockFreeQueue<T>

Create a LockFreeQueue with specified capacity.

impl<T: Send> LockFreeQueue<T>

fn push(&self, value: T) -> Result<(), T>

Push a value onto a queue.

If the queue is full, the value is returned in the Err().

fn pop(&self) -> Option<T>

Pop a value from a queue.

If the queue is empty, None is returned.

Trait Implementations

impl<T: Send> Send for LockFreeQueue<T>

impl<T: Send> Sync for LockFreeQueue<T>