Documentation
¶
Overview ¶
package backoff implemenets policies for waiting differente ammounts of times when retrying something.
Taken from Peter Teichman's post on http://blog.gopheracademy.com/advent-2014/backoff/
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Default is a backoff policy ranging up to 5 seconds. Default = IncreasePolicy{ []int{0, 10, 10, 100, 100, 500, 500, 3000, 3000, 5000}, } Random = RandomPolicy{10 * time.Second} )
Functions ¶
This section is empty.
Types ¶
type IncreasePolicy ¶
type IncreasePolicy struct {
Millis []int
}
IncreasePolicy implements a backoff policy, randomizing its delays and saturating at the final value in Millis.
type RandomPolicy ¶
Click to show internal directories.
Click to hide internal directories.