backoff

package
v0.42.0 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2026 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 BackOff

type BackOff interface {
	// GetNextBackoffTime returns the duration to wait before retrying the operation.
	GetNextBackoffTime()

	// Reset to ExponentialBackoff initial state.
	ResetExponentialBackoff()
}

BackOff interface defines Exponential-Backoff mechanism.

type ExponentialBackoff

type ExponentialBackoff struct {
	Start bool
	// contains filtered or unexported fields
}

ExponentialBackoff holds the configuration for the ExponentialBackoff mechanism.

func NewExponentialBackOffConfig

func NewExponentialBackOffConfig(attempt uint, multiplier uint, thresholdTime time.Duration) *ExponentialBackoff

NewExponentialBackOffConfig returns new ExponentialBackoff.

func (*ExponentialBackoff) GetNextBackoffTime

func (e *ExponentialBackoff) GetNextBackoffTime() time.Duration

GetNextBackoffTime returns the duration to wait before retrying the operation.

func (*ExponentialBackoff) ResetExponentialBackoff

func (e *ExponentialBackoff) ResetExponentialBackoff()

ResetExponentialBackoff resets the ExponentialBackoff to initial state.

Jump to

Keyboard shortcuts

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