Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Jitter ¶
Jitter should return a new wait duration optionally with some time added or removed to create some randomness in wait time.
type Waiter ¶
type Waiter struct { // MinFailures before exponential backoff starts. Any failures before // MinFailures is reached will wait MinWait time. MinFailures uint // MinWait time. Returned after the first failure. MinWait time.Duration // MaxWait time applied before Jitter. Note that the actual maximum wait time // is MaxWait + MaxWait * Jitter. MaxWait time.Duration // Jitter to add to each wait time. The Jitter is applied after MaxWait, which // may cause the actual wait time to exceed MaxWait. Jitter Jitter // Factor is the multiplier to use when calculating the delay. Defaults to // 1 second. Factor time.Duration // contains filtered or unexported fields }
Waiter records the number of failures and performs exponential backoff when when there are consecutive failures.
Click to show internal directories.
Click to hide internal directories.