Registry / utility / lestrrat-go-backoff-v2

lestrrat-go-backoff-v2

JSON →
library2.0.8gogounverified

Implements backoff algorithms for retrying operations with configurable policies.

go get github.com/lestrrat-go/backoff/v2
INSTALL
IMPORT
SIG · LESTRRAT-GO-BACKOF
L
lestrrat-go-backoff-v2
utilitygov2.0.8
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/lestrrat-go/backoff/v2

Create an exponential backoff policy and iterate retries.

package main import ( "context" "fmt" "time" "github.com/lestrrat-go/backoff/v2" ) func main() { policy := backoff.NewExponential() b, cancel := policy.Start(context.Background()) defer cancel() for backoff.Continue(b) { fmt.Println("retrying...") time.Sleep(b.Next()) } }
Debug
Known issues
breakingVersion 2.x uses a different API from v1; the import path includes /v2.
fix
Use `go get github.com/lestrrat-go/backoff/v2` and import with the /v2 suffix.
affects: >=2.0.0
Upgrade
Version history
2.0.8latest on pkg.go.dev
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
lestrrat-go-backoff-v2 — go get lestrrat-go-backoff-v2 · libregistry