TickHandler

Trait TickHandler 

Source
pub trait TickHandler: Send + Sync {
    // Required methods
    fn tick_duration(&self) -> Duration;
    fn on_tick(&self, tick_count: u64, now_ns: u64);
    fn on_shutdown(&self);
}
Expand description

Trait for services that need to be notified on each tick.

Required Methods§

Source

fn tick_duration(&self) -> Duration

Returns the desired tick duration for this handler. The TickService will use the minimum of all registered handlers’ tick durations.

Source

fn on_tick(&self, tick_count: u64, now_ns: u64)

Called on each tick with the current time in nanoseconds and tick count.

Source

fn on_shutdown(&self)

Called when the tick service is shutting down.

Implementors§

Source§

impl<const P: usize, const NUM_SEGS_P2: usize> TickHandler for WorkerService<P, NUM_SEGS_P2>