backoff

package
v0.0.0-...-9204231 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 11, 2026 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Overview

Package backoff provides retry backoff utilities including jitter to prevent thundering herd effects when multiple clients retry simultaneously.

Index

Constants

View Source
const JitterFraction = 0.25

JitterFraction is the proportion of the base duration used for jitter. A value of 0.25 means the returned duration will be in the range [base * 0.75, base * 1.25].

Variables

This section is empty.

Functions

func WithJitter

func WithJitter(d time.Duration) time.Duration

WithJitter adds +/-25% random jitter to a duration to prevent thundering herd effects. The result is always non-negative; if the computed value would go below zero (extremely short durations), zero is returned.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL