(maxRetries uint, baseTime time.Duration, retryForever bool)
| 38 | } |
| 39 | |
| 40 | func NewBackoff(maxRetries uint, baseTime time.Duration, retryForever bool) BackoffHandler { |
| 41 | return BackoffHandler{ |
| 42 | maxRetries: maxRetries, |
| 43 | baseTime: baseTime, |
| 44 | retryForever: retryForever, |
| 45 | Clock: Clock{Now: time.Now, After: time.After}, |
| 46 | } |
| 47 | } |
| 48 | |
| 49 | func (b BackoffHandler) GetMaxBackoffDuration(ctx context.Context) (time.Duration, bool) { |
| 50 | // Follows the same logic as Backoff, but without mutating the receiver. |
no outgoing calls