[][src]Struct kwait::ExponentialBackoffManager

pub struct ExponentialBackoffManager { /* fields omitted */ }

Implementations

impl ExponentialBackoffManager[src]

pub fn new_exponential_backoff_manager(
    init_backoff: Duration,
    max_backoff: Duration,
    reset_duration: Duration,
    backoff_factor: f64,
    jitter: f64
) -> Box<dyn BackoffManager>
[src]

new_exponential_backoff_manager returns a manager for managing exponential backoff. Each backoff is jittered and backoff will not exceed the given max. If the backoff is not called within reset_duration, the backoff is reset. This backoff manager is used to reduce load during upstream unhealthiness.

Trait Implementations

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

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,