pub enum BackoffConfig {
Constant {
delay: DurationString,
max_retries: Nullable<usize>,
jitter_enabled: bool,
jitter_seed: Option<u64>,
},
Exponential {
initial_delay: DurationString,
factor: f32,
max_delay: Nullable<DurationString>,
max_retries: Nullable<usize>,
max_total_delay: Option<DurationString>,
jitter_enabled: bool,
jitter_seed: Option<u64>,
},
Fibonacci {
initial_delay: DurationString,
max_delay: Nullable<DurationString>,
max_retries: Nullable<usize>,
jitter_enabled: bool,
jitter_seed: Option<u64>,
},
}Expand description
Configuration for Backoff.
Variants§
Constant
Configuration for Backoff::Constant.
Fields
delay: DurationStringBackoff delay.
Defaults to 500 millis - see defaults::delay.
max_retries: Nullable<usize>Maximum amount of retries.
Removes the retry limit if the value is Nullable::Null.
Defaults to 4 - see defaults::max_retries.
jitter_enabled: boolWhether jitter is enabled.
Defaults to true - see defaults::jitter_enabled.
jitter_seed: Option<u64>Random seed to initialize the random jitter generator.
Defaults to None - see defaults::jitter_seed.
Exponential
Configuration for Backoff::Exponential.
Fields
initial_delay: DurationStringInitial backoff delay.
Defaults to 500 millis - see defaults::delay.
factor: f32Backoff factor.
Defaults to 2.0 - see defaults::factor.
max_delay: Nullable<DurationString>Maximum backoff delay.
Removes the max backoff delay limit if the value is Nullable::Null.
Defaults to 60 seconds - see defaults::max_delay.
max_retries: Nullable<usize>Maximum amount of retries.
Removes the retry limit if the value is Nullable::Null.
Defaults to 4 - see defaults::max_retries.
max_total_delay: Option<DurationString>Maximum total backoff delay.
Defaults to None - see defaults::max_total_delay
jitter_enabled: boolWhether jitter is enabled.
Defaults to true - see defaults::jitter_enabled.
jitter_seed: Option<u64>Random seed to initialize the random jitter generator.
Defaults to None - see defaults::jitter_seed.
Fibonacci
Configuration for Backoff::Fibonacci.
Fields
initial_delay: DurationStringInitial backoff delay.
Defaults to 500 millis - see defaults::delay.
max_delay: Nullable<DurationString>Maximum backoff delay.
Removes the max backoff delay limit if the value is Nullable::Null.
Defaults to 60 seconds - see defaults::max_delay.
max_retries: Nullable<usize>Maximum amount of retries.
Removes the retry limit if the value is Nullable::Null.
Defaults to 4 - see defaults::max_retries.
jitter_enabled: boolWhether jitter is enabled.
Defaults to true - see defaults::jitter_enabled.
jitter_seed: Option<u64>Random seed to initialize the random jitter generator.
Defaults to None - see defaults::jitter_seed.
Trait Implementations§
Source§impl BackoffBuilder for BackoffConfig
impl BackoffBuilder for BackoffConfig
Source§impl Clone for BackoffConfig
impl Clone for BackoffConfig
Source§fn clone(&self) -> BackoffConfig
fn clone(&self) -> BackoffConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more