pub enum ConsumerMode {
Blocking,
NonBlocking,
}
Expand description
The blocking mode for a consumer
Blocking consumers prevent producers from writing new items in the queue that would replace items not already seen by the consumer.
On the contrary, non-blocking consumers do not block producers, enabling producers to still write onto the queue.
Non-blocking consumers then run the risk of lagging behind. In that case trying to receive messages will produce TryRecvError::Lagging
.
Variants§
Blocking
In Blocking
mode, a consumer is guaranteed to see all items from producers
NonBlocking
In NonBlocking
mode, a consumer may lag behind producers and may not see all items from producers
Trait Implementations§
Source§impl Clone for ConsumerMode
impl Clone for ConsumerMode
Source§fn clone(&self) -> ConsumerMode
fn clone(&self) -> ConsumerMode
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for ConsumerMode
impl Debug for ConsumerMode
Source§impl Default for ConsumerMode
impl Default for ConsumerMode
Source§fn default() -> ConsumerMode
fn default() -> ConsumerMode
Returns the “default value” for a type. Read more
Source§impl Hash for ConsumerMode
impl Hash for ConsumerMode
Source§impl PartialEq for ConsumerMode
impl PartialEq for ConsumerMode
impl Copy for ConsumerMode
impl Eq for ConsumerMode
impl StructuralPartialEq for ConsumerMode
Auto Trait Implementations§
impl Freeze for ConsumerMode
impl RefUnwindSafe for ConsumerMode
impl Send for ConsumerMode
impl Sync for ConsumerMode
impl Unpin for ConsumerMode
impl UnwindSafe for ConsumerMode
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more