Registry / utility / jpillora-backoff

jpillora-backoff

JSON →
library1.0.0gogounverified

Package backoff provides an exponential-backoff implementation.

go get github.com/jpillora/backoff
INSTALL
IMPORT
SIG · JPILLORA-BACKOFF
J
jpillora-backoff
utilitygov1.0.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

backoff
github.com/jpillora/backoff

Creates a backoff instance and prints durations for each attempt.

package main import ( "fmt" "time" "github.com/jpillora/backoff" ) func main() { b := &backoff.Backoff{ Min: 100 * time.Millisecond, Max: 10 * time.Second, Factor: 2, Jitter: true, } for i := 0; i < 5; i++ { d := b.Duration() fmt.Printf("Attempt %d: waiting %v\n", i+1, d) time.Sleep(d) } }
Debug
Known issues

No known issues recorded.

Upgrade
Version history
1.0.0latest on pkg.go.dev
Audit
Dependencies

No dependency data recorded yet.

Agent activity
6 hits · last 30 days
node
6
Resources
jpillora-backoff — go get jpillora-backoff · libregistry