Exponential Backoff
Go
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
LICENSE
README.md
backoff.go
backoff_test.go

README.md

Backoff

Simple implementation of an exponential backoff mechanism, including helpers for establishing network connections.

go get github.com/jamescun/backoff

GoDoc

Example

b := backoff.New(100 * time.Millisecond, 5)

err := b.Do(func() error {
    conn, err = net.Dial("tcp", "flapping-network-server.local:80")
    if err != nil {
        return err
    }

    return nil
})