Struct qp2p::config::RetryConfig[][src]

pub struct RetryConfig {
    pub initial_retry_interval: Duration,
    pub max_retry_interval: Duration,
    pub retry_delay_multiplier: f64,
    pub retry_delay_rand_factor: f64,
    pub retrying_max_elapsed_time: Duration,
}
Expand description

Retry configurations for establishing connections and sending messages. Determines the retry behaviour of requests, by setting the back off strategy used.

Fields

initial_retry_interval: Duration

The initial retry interval.

This is the first delay before a retry, for establishing connections and sending messages. The subsequent delay will be decided by the retry_delay_multiplier.

max_retry_interval: Duration

The maximum value of the back off period. Once the retry interval reaches this value it stops increasing.

This is the longest duration we will have, for establishing connections and sending messages. Retrying continues even after the duration times have reached this duration. The number of retries before that happens, will be decided by the retry_delay_multiplier. The number of retries after that, will be decided by the retrying_max_elapsed_time.

retry_delay_multiplier: f64

The value to multiply the current interval with for each retry attempt.

retry_delay_rand_factor: f64

The randomization factor to use for creating a range around the retry interval.

A randomization factor of 0.5 results in a random period ranging between 50% below and 50% above the retry interval.

retrying_max_elapsed_time: Duration

The maximum elapsed time after instantiating

Retrying continues until this time has elapsed. The number of retries before that happens, will be decided by the other retry config options.

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

Serialize this value into the given Serde serializer. 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.

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