Skip to main content

BoundedTimeoutQueue

Type Alias BoundedTimeoutQueue 

Source
pub type BoundedTimeoutQueue<T> = TimeoutQueue<T, Slab<WheelEntry<T>>>;
Expand description

A timeout queue backed by a fixed-capacity slab.

Aliased Type§

pub struct BoundedTimeoutQueue<T> { /* private fields */ }

Implementations§

Source§

impl<T: 'static> BoundedTimeoutQueue<T>

Source

pub fn bounded(timeout: Duration, capacity: usize, now: Instant) -> Self

Creates a bounded timeout queue with the default 1ms tick.

Every timer fires timeout after the now passed to schedule. The now here fixes the reference epoch — pass one monotone clock source (e.g. Instant::now()) here and to every schedule/poll. For a custom tick duration, use TimeoutQueueBuilder.

§Panics

Panics if timeout is zero. Use [TimeoutQueueBuilder::build] to handle a runtime-sourced timeout without panicking.