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,
}
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
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
pub fn deserialize<__D>(
__deserializer: __D
) -> Result<Config, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
pub fn deserialize<__D>(
__deserializer: __D
) -> Result<Config, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations
impl RefUnwindSafe for Config
impl UnwindSafe for Config
Blanket Implementations
Mutably borrows from an owned value. Read more
Wrap the input message T
in a tonic::Request
pub fn vzip(self) -> V
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