Documentation
¶
Overview ¶
Package backoff holds the retry-delay policies shared by the outbox relay, the queue and webhook batteries, and the log webhook sink. It is dependency-free and low-level so the framework tree and the batteries (which sit above it but not above each other) reuse one implementation instead of maintaining copies.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func At ¶
At returns the wait after the given attempt from a positional schedule: table[attempts-1], reusing the final entry once attempts runs past the table. attempts < 1 reads as the first attempt; an empty table yields zero.
func Exponential ¶
Exponential returns the delay before the next retry for the attempt that just failed (attempts >= 1): base*2^(attempts-1), clamped to max when max is positive. attempts <= 1 yields base. A zero base yields zero. Callers gate on base > 0 before applying backoff. Doubling stops at the largest value whose next doubling could overflow int64, so any attempt count is safe.
Types ¶
This section is empty.