Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Exponential ¶
type Exponential struct {
// contains filtered or unexported fields
}
Exponential is an exponential backoff strategy with jitter. Under the aws backoff strategies this is a "Full Jitter" backoff implementation https://www.awsarchitectureblog.com/2015/03/backoff.html with the addition of a Min and Max Value. The range of durations will be contained in a closed [Min, Max] interval. It is a stateless implementation and is safe to use concurrently.
func NewExponential ¶
func NewExponential(opts ...ExponentialOption) (*Exponential, error)
NewExponential returns a new Exponential Backoff Strategy.
type ExponentialOption ¶
type ExponentialOption func(*exponentialOptions)
ExponentialOption defines options that can be applied to an exponential backoff stragety
func BaseJump ¶
func BaseJump(t time.Duration) ExponentialOption
BaseJump sets the default "jump" the exponential backoff strategy will use.
func MaxBackoff ¶
func MaxBackoff(t time.Duration) ExponentialOption
MaxBackoff sets absolute max time that will ever be returned for a backoff.
func MinBackoff ¶
func MinBackoff(t time.Duration) ExponentialOption
MinBackoff sets absolute min time that will ever be returned for a backoff.