pub trait LockFreeProducer<T>: Producer<T> {
// Required method
fn lock_free_maybe_push(&self, value: T) -> Result<(), LockFreePushErr<T>>;
}Expand description
A lock-free producer of a queue.
Required Methods§
Sourcefn lock_free_maybe_push(&self, value: T) -> Result<(), LockFreePushErr<T>>
fn lock_free_maybe_push(&self, value: T) -> Result<(), LockFreePushErr<T>>
Pushes a value only if the queue is not full.
On failure, returns Err(LockFreePushErr).
It is lock-free.
If you can lock, you can look at the Producer::maybe_push method
because if it is implemented not as lock-free, it should have better performance.