Backoff Strategies

Four backoff functions passed to Retry / RetryIf / RetryAll. Constant, Linear, Exponential, and Exponential Jitter (the default for SmartResilience, with ±30% crypto-rand jitter to prevent thundering herd).

0s1s2s3s4s5s123456attemptmax cap (5s)Constant (1s)Linear (0.5s)ExponentialExp + Jitter

Signature

action contract
func ExponentialBackoff(base, max time.Duration) func(attempt int) time.Duration