Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultBackoff = &Backoff{ Min: 100 * time.Millisecond, Max: 10 * time.Second, Factor: 2.0, Jitter: false, }
Functions ¶
This section is empty.
Types ¶
type Backoff ¶
type Backoff struct { // Factor is the multiplying factor for each increment step Factor float64 // Jitter eases contention by randomizing backoff steps Jitter bool // Min and Max are the minimum and maximum values of the counter Min, Max time.Duration // contains filtered or unexported fields }
Backoff is a time.Duration counter. It starts at Min. After every call to Duration() it is multiplied by Factor. It is capped at Max. It returns to Min on every call to Reset(). Used in conjunction with the time package.
Click to show internal directories.
Click to hide internal directories.