exponentialWithJitter is a struct that implements the BackoffStrategy interface using a exponential backoff strategy.
| 171 | |
| 172 | // exponentialWithJitter is a struct that implements the BackoffStrategy interface using a exponential backoff strategy. |
| 173 | type exponentialWithJitter struct { |
| 174 | base time.Duration // base is the multiplier for the exponential backoff. |
| 175 | interval time.Duration // interval is the current backoff interval, which will be adjusted over time. |
| 176 | maxJitter time.Duration // maxJitter is the maximum amount of jitter to apply to the backoff interval. |
| 177 | } |
| 178 | |
| 179 | // CalculateInterval calculates the next backoff interval with jitter and updates the interval. |
| 180 | func (e *exponentialWithJitter) CalculateInterval() time.Duration { |
nothing calls this directly
no outgoing calls
no test coverage detected