Trait pendulum::Pendulum [] [src]

pub trait Pendulum<T> {
    fn insert_timeout(
        &mut self,
        timeout: Duration,
        item: T
    ) -> PendulumResult<Token, T>;
fn remove_timeout(&mut self, token: Token) -> Option<T>;
fn expired_timeout(&mut self) -> Option<T>;
fn tick(&mut self);
fn tick_duration(&self) -> Duration;
fn max_capacity(&self) -> usize;
fn max_timeout(&self) -> Duration; }

Trait for working with generic timer wheel implementations.

Required Methods

Insert a timeout with the given duration and the given item into the Pendulum.

Removes the timeout corresponding with the given Token, if one exists.

Retrieve the next expired timeout from the Pendulum.

This is a non-blocking operation.

Tick the Pendulum once.

Configured tick duration for this Pendulum.

Configured max timeout capacity for this Pendulum.

Configured maximum timeout for this Pendulum.

Implementors