interval

package
v2.13.0 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Calculator

type Calculator interface {
	NextInterval(req ctrl.Request, result ctrl.Result, err error) (ctrl.Result, error)
}

Calculator calculates an interval

func NewCalculator

func NewCalculator(params CalculatorParameters) Calculator

NewCalculator creates a new Calculator.

type CalculatorParameters

type CalculatorParameters struct {
	Rand *rand.Rand
	// ErrorBaseDelay is the base delay for exponential backoff of errors.
	ErrorBaseDelay time.Duration
	// ErrorMaxFastDelay is the maximum delay duration (computed via exponential backoff) for retry.Fast errors.
	ErrorMaxFastDelay time.Duration
	// ErrorMaxSlowDelay is the maximum delay duration (computed via exponential backoff) for retry.Slow errors.
	ErrorMaxSlowDelay time.Duration
	// ErrorVerySlowDelay is the retry.VerySlow error delay. These errors do not follow an exponential backoff and
	// instead jump straight to this delay, with some jitter to avoid retry storms.
	ErrorVerySlowDelay time.Duration
	// SyncPeriod is the duration after which to re-sync healthy (non-error) requests. If omitted, requests are not
	// re-synced periodically.
	SyncPeriod           *time.Duration
	RequeueDelayOverride time.Duration
}

Jump to

Keyboard shortcuts

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