Files
micro/client/backoff.go
2020-10-20 10:15:39 +01:00

15 lines
319 B
Go

package client
import (
"context"
"time"
"github.com/asim/go-micro/v3/util/backoff"
)
type BackoffFunc func(ctx context.Context, req Request, attempts int) (time.Duration, error)
func exponentialBackoff(ctx context.Context, req Request, attempts int) (time.Duration, error) {
return backoff.Do(attempts), nil
}