pub struct EventQueue { /* private fields */ }Implementations§
Source§impl EventQueue
impl EventQueue
pub fn new(lane: QueueLane, capacity: u64) -> EventQueue
Sourcepub fn enqueue(
&mut self,
key: IdemKey,
payload: Payload,
now: TimeMs,
) -> Result<Admission, StorageError>
pub fn enqueue( &mut self, key: IdemKey, payload: Payload, now: TimeMs, ) -> Result<Admission, StorageError>
Admission first, then storage. A duplicate key is admitted-and- ignored rather than refused: the sender did its job, and telling it otherwise would invite a retry that changes nothing.
§Errors
Returns nothing today; the fallible signature is the port’s, and storage that can fail is what it is there for.
Sourcepub fn consume(&mut self) -> Option<QueueItem>
pub fn consume(&mut self) -> Option<QueueItem>
Takes the oldest item. The key stays in seen, so a late
duplicate arriving after consumption is still recognised.
pub fn stats(&self) -> QueueStats
pub fn len(&self) -> u64
pub fn is_empty(&self) -> bool
pub fn lane(&self) -> QueueLane
Sourcepub fn shed_count(&self) -> u64
pub fn shed_count(&self) -> u64
Counters for the accounting payloads: how many were refused, how many arrived twice.
pub fn duplicate_count(&self) -> u64
Auto Trait Implementations§
impl Freeze for EventQueue
impl RefUnwindSafe for EventQueue
impl Send for EventQueue
impl Sync for EventQueue
impl Unpin for EventQueue
impl UnsafeUnpin for EventQueue
impl UnwindSafe for EventQueue
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