Documentation ¶
Overview ¶
Package backoff provides varies backoff strategies for retry.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Strategy ¶
Strategy is a function that provides the amount of time to wait before trying again. Note: attempts starts at 1
func BinaryExponential ¶
BinaryExponential returns an Exponential strategy with a base of 2.0
delay = baseDelay * 2^(attempts - 1) Ex. BinaryExponential(2*time.Seconds) = 2s, 4s, 8s, 16s, ...
func Exponential ¶
Exponential returns a strategy that exponentially increases based off of the number of attempts.
delay = baseDelay * base^(attempts - 1) Ex. Exponential(2*time.Seconds, 3) = 2s, 6s, 18s, 54s, ...
Click to show internal directories.
Click to hide internal directories.