backoff

package
v0.0.0-...-2bf1e3b Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2024 License: Apache-2.0 Imports: 2 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 struct {
	// The period for which failures will be evaluated.
	Period time.Duration

	// The amount of delay to add after each additional failure (can not
	// be zero).
	X time.Duration

	// The Maximum back off allowed.
	Max time.Duration
	// contains filtered or unexported fields
}

Tracks errors and automatically backs off if there has been too many issues in a short period of time. This implements a exponential back off when too many errors have been encountered over a short period.

func (*BackOff) Failure

func (b *BackOff) Failure()

Inserts an error into the BackOff queue.

func (*BackOff) Healthy

func (b *BackOff) Healthy() bool

func (*BackOff) Wait

func (b *BackOff) Wait() time.Duration

Returns the amount of time that needs to be waited in order to slow down operations due to the back off function.

Jump to

Keyboard shortcuts

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