[][src]Trait kwait::BackoffManager

pub trait BackoffManager {
    fn backoff(&mut self) -> Receiver<Instant>;
}

BackoffManager manages backoff with a particular scheme based on its underlying implementation. It provides an interface to return a timer for backoff, and caller shall backoff until Timer.C() drains. If the second backoff() is called before the timer from the first backoff() call finishes, the first timer will NOT be drained and result in undetermined behavior. The BackoffManager is supposed to be called in a single-threaded environment.

Required methods

fn backoff(&mut self) -> Receiver<Instant>

Loading content...

Implementors

impl BackoffManager for ExponentialBackoffManager[src]

fn backoff(&mut self) -> Receiver<Instant>[src]

Backoff implements BackoffManager.backoff, it returns a timer so caller can block on the timer for exponential backoff. The returned timer must be drained before calling backoff() the second time

impl BackoffManager for JitteredBackoffManager[src]

fn backoff(&mut self) -> Receiver<Instant>[src]

backoff implements BackoffManager.backoff, it returns a timer so caller can block on the timer for jittered backoff. The returned timer must be drained before calling backoff() the second time

Loading content...