Documentation
¶
Overview ¶
Package retry runs a fallible block of code until it succeeds.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Retrier ¶ added in v1.3.0
type Retrier struct {
// Delay is the current delay between attempts.
Delay time.Duration
// Floor and Ceil are the minimum and maximum delays.
Floor, Ceil time.Duration
// Rate is the rate at which the delay grows.
// E.g. 2 means the delay doubles each time.
Rate float64
// Jitter determines the level of indeterminism in the delay.
//
// It is the standard deviation of the normal distribution of a random variable
// multiplied by the delay. E.g. 0.1 means the delay is normally distributed
// with a standard deviation of 10% of the delay. Floor and Ceil are still
// respected, making outlandish values impossible.
//
// Jitter can help avoid thundering herds.
Jitter float64
}
Retrier implements an exponentially backing off retry instance. Use New instead of creating this object directly.
Click to show internal directories.
Click to hide internal directories.