backoffdelay

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2023 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 Sleeper

type Sleeper interface {
	Sleep()
}

func NewExponential

func NewExponential(minimumDelay, maximumDelay time.Duration,
	growthRate uint) Sleeper

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

Jump to

Keyboard shortcuts

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