vgarvardt / backoff

Backoff implementation extracted from Google gRPC

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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)
    ...
}

About

Backoff implementation extracted from Google gRPC

License:Apache License 2.0


Languages

Language:Go 100.0%