1
0
mirror of https://github.com/go-micro/go-micro.git synced 2024-12-18 08:26:38 +02:00
go-micro/client/backoff.go

15 lines
307 B
Go
Raw Normal View History

2016-04-05 21:04:37 +02:00
package client
import (
2018-03-03 13:53:52 +02:00
"context"
2016-04-05 21:04:37 +02:00
"time"
2021-10-12 13:55:53 +02:00
"go-micro.dev/v4/util/backoff"
2016-04-05 21:04:37 +02:00
)
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
2016-04-05 21:04:37 +02:00
}