struct PacketQueue<K, T> {
state: SyncMutex<PacketQueueState<K, T>>,
limits: PacketAdmissionLimits,
work_available: Condvar,
idle: Notify,
progress: Notify,
}Expand description
Bounded ordered multi-producer lanes with a finite snapshot drain at each tick boundary.
Fields§
§state: SyncMutex<PacketQueueState<K, T>>§limits: PacketAdmissionLimits§work_available: Condvar§idle: Notify§progress: NotifyImplementations§
Source§impl<K, T> PacketQueue<K, T>
impl<K, T> PacketQueue<K, T>
fn new() -> Self
fn with_limits(limits: PacketAdmissionLimits) -> Self
fn try_submit( &self, key: K, execution: ScheduledPacketExecution, admission_bytes: usize, value: T, ) -> Result<(), PacketAdmissionError>
fn open(&self)
async fn drain_for_tick(&self)
fn finish_tick_drain(&self, before_sequence: u64)
fn begin_tick_drain(&self) -> Option<(u64, bool)>
fn tick_drain_complete(&self, before_sequence: u64) -> bool
async fn wait_for_progress_since(&self, completed: u64)
fn progress_baseline(&self) -> Option<u64>
fn has_progress_since(&self, completed: u64) -> bool
fn has_work(state: &PacketQueueState<K, T>) -> bool
fn discard_lane(&self, key: K)
fn stop(&self)
fn next(&self) -> Option<PacketWork<'_, K, T>>
fn start_next( state: &mut PacketQueueState<K, T>, before_sequence: Option<u64>, ) -> Option<(K, ScheduledPacketExecution, usize, T)>
fn select_next( state: &PacketQueueState<K, T>, before_sequence: Option<u64>, ) -> Option<(u64, K, ScheduledPacketExecution)>
fn finish_one( &self, key: K, execution: ScheduledPacketExecution, admission_bytes: usize, )
fn mark_ready( state: &mut PacketQueueState<K, T>, sequence: u64, key: K, execution: ScheduledPacketExecution, )
fn next_ready_sequence(state: &PacketQueueState<K, T>) -> Option<u64>
Auto Trait Implementations§
impl<K, T> !Freeze for PacketQueue<K, T>
impl<K, T> !RefUnwindSafe for PacketQueue<K, T>
impl<K, T> Send for PacketQueue<K, T>
impl<K, T> Sync for PacketQueue<K, T>
impl<K, T> Unpin for PacketQueue<K, T>
impl<K, T> UnsafeUnpin for PacketQueue<K, T>
impl<K, T> UnwindSafe for PacketQueue<K, T>where
K: UnwindSafe,
T: UnwindSafe,
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreWraps this value in an
Arc<SyncMutex<>>