#[non_exhaustive]pub enum Jitter {
None,
Full,
Equal,
Decorrelated,
}Expand description
How retry delays are randomized to avoid synchronized retries.
The non-None modes follow the taxonomy from the AWS Architecture Blog’s
“Exponential Backoff And Jitter”: full, equal, and decorrelated.
#[non_exhaustive]: more modes may be added, so a match needs a wildcard.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
None
No randomization: the delay is exactly the (capped) base curve.
Full
Uniform in [0, delay]. Maximum spread; a retry can fire almost
immediately.
Equal
Half the delay plus a uniform half: delay/2 + rand(0, delay/2). Keeps a
floor under each wait while still spreading.
min(max, rand(base, previous * 3)). Self-correlated growth that adapts to
observed waits; the strongest at breaking up a thundering herd, and the
default.
Trait Implementations§
impl Copy for Jitter
impl Eq for Jitter
impl StructuralPartialEq for Jitter
Auto Trait Implementations§
impl Freeze for Jitter
impl RefUnwindSafe for Jitter
impl Send for Jitter
impl Sync for Jitter
impl Unpin for Jitter
impl UnsafeUnpin for Jitter
impl UnwindSafe for Jitter
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more