go-micro.dev/v5@v5.12.0/client/backoff.go (about)

     1  package client
     2  
     3  import (
     4  	"context"
     5  	"time"
     6  
     7  	"go-micro.dev/v5/util/backoff"
     8  )
     9  
    10  type BackoffFunc func(ctx context.Context, req Request, attempts int) (time.Duration, error)
    11  
    12  func exponentialBackoff(ctx context.Context, req Request, attempts int) (time.Duration, error) {
    13  	return backoff.Do(attempts), nil
    14  }