Struct hedwig::googlepubsub::retry_policy::exponential_backoff::Config[][src]

pub struct Config {
    pub initial_interval: Duration,
    pub max_interval: Duration,
    pub multiplier: f32,
    pub max_retries: Option<usize>,
    pub randomization_factor: f32,
}
This is supported on crate feature google only.
Expand description

Configuration values for ExponentialIter

Fields

initial_interval: Duration

The initial delay before the first retry attempt is made

max_interval: Duration

The maximum delay between retry attempts.

Once this interval is reached, the exponential growth will stop and this value will be returned for all subsequent polls

multiplier: f32

The multiplication factor for the exponential growth.

The delay between each retry attempt will increase by this factor for each attempted retry

max_retries: Option<usize>

The number of times that retry attemps will be made before the underlying error is returned

A value of None will cause the retries to continue indefinitely

randomization_factor: f32

The multiplication factor controlling the randomization applied to the retry intervals.

Each retry interval will be randomly selected from a time span around the calculated exponential interval. That time span’s length is determined by multiplying the calculated interval by this randomization factor, then creating a range of twice that length centered on the calculated interval. For example, with a calculated interval of 20ms and a randomization factor of 0.5, the potential range of the output interval would be [20 * (1 - 0.5), 20 * (1 + 0.5)] or 10ms..=30ms.

This value must be at least zero and no greater than 1. Setting the value to zero will essentially disable the randomization such that only the calculated exponential intervals are used.

Implementations

Construct a new instance with the default values

Set this field to the given value

Set this field to the given value

Set this field to the given value

Set this field to the given value

Set this field to the given value

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Deserialize this value from the given Serde deserializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

Wrap the input message T in a tonic::Request

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more