/backoff

Backoff implementation extracted from Google gRPC

Primary LanguageGoApache License 2.0Apache-2.0

Backoff

Exponential backoff implementation extracted from gRPC-Go

gRPC-Go has really nice exponential backoff implementation, but it is impossible to reuse as it resides in internal package, so it can be imported only within gRPC-Go.

Usage

package main

import "github.com/vgarvardt/backoff"

func main() {
    retry := 5
    waitFor := backoff.DefaultExponential.Backoff(retry)
    ...
}