Skip to content

Commit

Permalink
Update section about MaxRetries (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
wietsevenema committed Dec 2, 2021
1 parent eb868fa commit 80daa4e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,16 +135,16 @@ b = WithJitterPercent(5, b)

### MaxRetries

To terminate a retry, specify the maximum number of _retry_ attempts. Note this
is _retries_, not _attempts_. Attempts is retries - 1.
To terminate a retry, specify the maximum number of _retries_. Note this
is _retries_, not _attempts_. Attempts is retries + 1.

```golang
b, err := NewFibonacci(1 * time.Second)
if err != nil {
// handle err
}

// Stop when the 5th retry has failed. In this example, the worst case elapsed
// Stop after 4 retries, when the 5th attempt has failed. In this example, the worst case elapsed
// time would be 1s + 1s + 2s + 3s = 7s.
b = WithMaxRetries(4, b)
```
Expand Down

0 comments on commit 80daa4e

Please sign in to comment.