Skip to main content

IdleStrategy

Trait IdleStrategy 

Source
pub trait IdleStrategy {
    // Required method
    fn idle(&mut self, work_count: i32);

    // Provided method
    fn reset(&mut self) { ... }
}
Expand description

Back off a poll loop when the last cycle did no work. Mirrors Aeron’s IdleStrategy: idle(work_count) returns immediately when work_count > 0, otherwise spins / yields / sleeps depending on the implementation.

Required Methods§

Source

fn idle(&mut self, work_count: i32)

Called with the work/fragment count from the last operation. Implementations return immediately when work_count > 0 (work was done) and back off otherwise.

Provided Methods§

Source

fn reset(&mut self)

Reset accumulated backoff state after a productive period. Default: no-op.

Implementors§