| 27 | import "math" |
| 28 | |
| 29 | type ExponentialBackoff struct { |
| 30 | // interval * exponential_rate ^ retry_number |
| 31 | Interval float64 |
| 32 | ExponentialRate float64 |
| 33 | RetryNumber float64 |
| 34 | |
| 35 | MaxDifference float64 |
| 36 | } |
| 37 | |
| 38 | func (eb *ExponentialBackoff) calculate(retry float64) float64 { |
| 39 | return eb.Interval * math.Pow(eb.ExponentialRate, retry) |
nothing calls this directly
no outgoing calls
no test coverage detected