backoff

package
v0.33.0 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithContext

func WithContext(ctx context.Context, backoff Stepper, condition wait.ConditionWithContextFunc) error

Types

type InfiniteBackoff

type InfiniteBackoff struct {
	// The initial duration.
	Duration time.Duration

	// Factor is used to scale up the Duration until it reaches MaxDuration.
	// Should be at least 1.0.
	Factor float64

	// A limit on step size. Once reached, this value will be used as the interval.
	MaxDuration time.Duration
	// contains filtered or unexported fields
}

func (*InfiniteBackoff) Step

func (b *InfiniteBackoff) Step() time.Duration

Step returns the next duration in the backoff sequence. It modifies the receiver and is not thread-safe.

type Stepper

type Stepper interface {
	Step() time.Duration
}

Jump to

Keyboard shortcuts

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