Documentation
¶
Overview ¶
Package retry provides exponential backoff with jitter. It is a policy calculator, not a loop runner: callers own their loops and contexts and ask Backoff what to wait. The same curve serves transport reconnection in core and the supervisor's crash-loop damping.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Backoff ¶
type Backoff struct {
// Initial is the base delay for attempt 0.
Initial time.Duration
// Max caps the computed delay.
Max time.Duration
// Factor multiplies the delay each attempt. Typically 2.
Factor float64
}
Backoff computes exponentially growing delays with full jitter. The zero value is not usable; use New or fill every field.
Click to show internal directories.
Click to hide internal directories.