10000 GitHub - matthewpi/backoff: Context-aware exponential backoff
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

matthewpi/backoff

Repository files navigation

Backoff

Godoc Reference Pipeline Status

Go package that provides a context-aware exponential backoff.

Usage

b := backoff.New(3, 2, 1*time.Second, 5*time.Second)

// Avoid generating a new context every time Next is called.
ctx := context.Background()
for b.Next(ctx) {
  // Do something.
  //
  // break if successful, continue on failure
}

ref; example_test.go

Installation

go get github.com/matthewpi/backoff

About

Context-aware exponential backoff

Topics

Resources

License

Stars

Watchers

Forks

Languages

0