backoff

package
v0.20.0 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Exponential

type Exponential struct {
	// contains filtered or unexported fields
}

Exponential configures an exponential backoff strategy.

func NewExponential

func NewExponential(baseDelay, maxDelay time.Duration, factor, jitter float64) *Exponential

NewExponential returns a new exponential backoff strategy.

func (Exponential) ForAttempt

func (b Exponential) ForAttempt(n int) time.Duration

forAttempt returns the duration to wait for the n-th attempt.

Jump to

Keyboard shortcuts

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