From f7f858ce97fd23189e7505a41e487cb3f50b9abc Mon Sep 17 00:00:00 2001 From: Umputun Date: Thu, 13 Jun 2019 03:03:15 -0500 Subject: [PATCH] fix readme, remove legacy strategy constructors --- README.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 76d8c90..50c315d 100644 --- a/README.md +++ b/README.md @@ -27,9 +27,8 @@ type Interface interface { Returned channels used as "ticks," i.e., for each repeat or initial operation one read from this channel needed. Closing this channel indicates "done with retries." It is pretty much the same idea as `time.Timer` or `time.Tick` implements. Note - the first (technically not-repeated-yet) call won't happen **until something sent to the channel**. For this reason, the typical strategy sends the first "tick" before the first wait/sleep. Three most common strategies provided by package and ready to use: -1. **Fixed delay**, up to max number of attempts - `NewFixedDelay(repeats int, delay time.Duration)`. -It is the default strategy used by `repeater.NewDefault` constructor -2. **BackOff** with jitter provides exponential backoff. It starts from 100ms interval and goes in steps with `last * math.Pow(factor, attempt)`. Optional jitter randomizes intervals a little bit. The strategy created by `NewBackoff(repeats int, factor float64, jitter bool)`. _Factor = 1 effectively makes this strategy fixed with 100ms delay._ -3. **Once** strategy does not do any repeats and mainly used for tests/mocks - `NewOnce()` +1. **Fixed delay**, up to max number of attempts. It is the default strategy used by `repeater.NewDefault` constructor +2. **BackOff** with jitter provides exponential backoff. It starts from `Duration` interval and goes in steps with `last * math.Pow(factor, attempt)`. Optional jitter randomizes intervals a little bit. The strategy created by `NewBackoff(repeats int, factor float64, jitter bool)`. _Factor = 1 effectively makes this strategy fixed with `Duration` delay._ +3. **Once** strategy does not do any repeats and mainly used for tests/mocks`