Documentation ¶
Overview ¶
Package backoff contains some basic implementations and a selector by strategy name
Index ¶
Constants ¶
This section is empty.
Variables ¶
var DefaultBackoffDuration = time.Second
DefaultBackoffDuration is the duration returned by the DefaultBackoff
Functions ¶
func DefaultBackoff ¶
DefaultBackoff always returns DefaultBackoffDuration
func ExponentialBackoff ¶
ExponentialBackoff returns ever increasing backoffs by a power of 2
func ExponentialJitterBackoff ¶
ExponentialJitterBackoff returns ever increasing backoffs by a power of 2 with +/- 0-33% to prevent sychronized requests.
func LinearBackoff ¶
LinearBackoff returns increasing durations, each a second longer than the last
func LinearJitterBackoff ¶
LinearJitterBackoff returns increasing durations, each a second longer than the last with +/- 0-33% to prevent sychronized requests.
Types ¶
type TimeToWaitBeforeRetry ¶
TimeToWaitBeforeRetry returns the duration to wait before retrying for the given time
func GetByName ¶
func GetByName(strategy string) TimeToWaitBeforeRetry
GetByName returns the WaitBeforeRetry function implementing the strategy