backoffdelay

package
v0.3.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 29, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

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()

type Resetter added in v0.3.4

type Resetter interface {
	Reset()
}

type Sleeper

type Sleeper interface {
	Sleep()
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL