backoff

package
v1.1.0-beta.0...-5753106 Latest Latest
Warning

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

Go to latest
Published: Nov 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 Backoffer

type Backoffer interface {
	// Backoff returns the duration to wait for the retryCnt-th retry.
	// retryCnt starts from 0.
	Backoff(retryCnt int) time.Duration
}

Backoffer is the interface to get backoff.

type Exponential

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

Exponential implements the exponential backoff algorithm without jitter. should create one instance for each operation that need retry.

func NewExponential

func NewExponential(baseBackoff time.Duration, multiplier float64, maxBackoff time.Duration) *Exponential

NewExponential creates a new Exponential backoff.

func (*Exponential) Backoff

func (b *Exponential) Backoff(retryCnt int) time.Duration

Backoff returns the duration to wait for the retryCnt-th retry. retryCnt starts from 0.

Jump to

Keyboard shortcuts

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