Discover Packages
github.com/joinsider/pulsequorum
internal
backoff
package
Version:
v0.0.6
Opens a new window with list of versions in this module.
Published: Nov 23, 2026
License: AGPL-3.0
Opens a new window with license information.
Imports: 3
Opens a new window with list of imports.
Imported by: 0 modules, 0 packages
The first number is the count of modules that contain a package that imports this one.
The module count is a better indicator of popularity than the package count.
A module with 100 importing packages is counted only once instead of 100 times,
reflecting the fact that the choice to use the package was likely made only once,
not 100 times.
A '?' means that the value hasn't been computed yet.
Opens a new window with list of known importers.
Documentation
Documentation
¶
Package backoff provides exponential backoff with jitter and context-aware
sleeping.
Sleep waits for d and reports false if ctx is cancelled first.
If d <= 0, it returns ctx.Err() == nil without waiting.
Backoff computes exponential reconnect delays with jitter (ADR 0006, ADR 0034).
It is not safe for concurrent use by multiple goroutines.
FullJitter returns a Backoff whose Wait returns delays in [0, cur) where
cur = min(maxD, minD*2^n). If randIntN is nil, math/rand/v2.Int64N is used.
HalfJitter returns a Backoff whose Wait returns delays in [cur/2, cur) and
doubles cur up to maxD on each call.
Reset restores the backoff delay to its initial minimum.
Wait returns the next jittered delay and advances the backoff state.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.