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
}
Click to show internal directories.
Click to hide internal directories.