This crates provides a sequentially locking Ring Buffer. It allows for a fast and non-writer-blocking SPMC-queue, where all consumers read all messages.
There are two ways of consuming from the queue. If threads share a ReadGuard through a shared reference, they will steal queue items from one anothers such that no two threads will read the same message. When a ReadGuard is cloned, the new ReadGuard's reading progress will no longer affect the other one. If two threads each use a separate ReadGuard, they will be able to read the same messages.
It is also important to keep in mind, that slow readers will be overrun by the writer if they do not consume messages quickly enough.
# use *;
let buffer = new;
let mut writer = buffer.try_lock.unwrap;
let mut reader = buffer.reader;
scope;