A concurrent multi-producer multi-consumer queue.
There are two kinds of queues:
Queues also have the capability to get closed at any point. When closed, no more items can be pushed into the queue, although the remaining items can still be popped.
These features make it easy to build channels similar to
std::sync::mpsc on top of this
use concurrent_queue::ConcurrentQueue; let q = ConcurrentQueue::unbounded(); q.push(1).unwrap(); q.push(2).unwrap(); assert_eq!(q.pop(), Ok(1)); assert_eq!(q.pop(), Ok(2));
A concurrent queue.