Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Exponential ¶ added in v0.3.4
type Exponential struct {
// contains filtered or unexported fields
}
func NewExponential ¶
func NewExponential(minimumDelay, maximumDelay time.Duration, growthRate uint) *Exponential
NewExponential creates a Sleeper with specified minimum and maximum delays. If minimumDelay is less than or equal to 0, the default is 1 second. If maximumDelay is less than or equal to minimumDelay, the default is 10 times minimumDelay. The Sleep interval will increase by a factor of 2 raised to the power of -growthRate. For example: 0: 1x 1: 0.5x 2: 0.25x
func (*Exponential) Reset ¶ added in v0.3.4
func (e *Exponential) Reset()
func (*Exponential) Sleep ¶ added in v0.3.4
func (e *Exponential) Sleep()
Click to show internal directories.
Click to hide internal directories.