Documentation
¶
Overview ¶
Package retry provides a small exponential backoff helper used by reconnect / retry loops across the codebase (gRPC stream reconnect, Docker engine reconnect, runtime probe retry).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Backoff ¶
type Backoff struct {
// Min is the base interval used for attempt 0. Must be > 0.
Min time.Duration
// Max is the upper bound on the (un-jittered) delay.
Max time.Duration
// Jitter spreads the delay by ±Jitter (e.g. 0.25 means ±25%).
// 0 disables jitter and produces deterministic doubling.
Jitter float64
// contains filtered or unexported fields
}
Backoff implements exponential backoff with optional jitter. It is NOT safe for concurrent use by multiple goroutines.
func (*Backoff) Next ¶
Next returns the next backoff delay and advances the attempt counter. The base delay doubles on each call up to Max, then jitter is applied.
Click to show internal directories.
Click to hide internal directories.