Documentation
¶
Index ¶
Constants ¶
View Source
const (
DefaultFactor float64 = 2.0
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Backoff ¶
type Backoff struct {
// contains filtered or unexported fields
}
Backoff calculation utility for retries.
func (*Backoff) GetRetries ¶
type Conf ¶
type Conf struct {
// Base start duration - backoff can be no shorter than the BaseStart.Add(JitterMin).
BaseStart time.Duration
// Base max duration - backoff can be no longer than the BaseMax.Add(JitterMax).
BaseMax time.Duration
// Backoff exponential growth factor.
Factor float64
// Min random duration to add to the backoff value to prevent potential
// upstream overloading during the simultaneous retry among clients implementing backoff.
// Must be less than JitterMax.
JitterMin time.Duration
// Max random duration to add to the backoff value to prevent potential
// upstream overloading during the simultaneous retry among clients implementing backoff.
// Must be greater than JitterMin.
JitterMax time.Duration
}
Click to show internal directories.
Click to hide internal directories.