Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IntervalGenerator ¶
IntervalGenerator used to generate next interval.
type Option ¶
type Option func(policy *exponentialPolicy)
func MaxInterval ¶
MaxInterval sets the upper bound of backoff delay.
func MinInterval ¶
MinInterval sets the amount of time to backoff after the first failure.
func Multiplier ¶
Multiplier multiplier is the factor with which to multiply backoffs after a failed retry. Should be greater than 1.
type Policy ¶
type Policy interface {
New() IntervalGenerator
}
Policy is an interface for the dial policies.
func NewExponentialPolicy ¶
NewExponentialPolicy returns a exponential backoff policy
func NewFixedIntervalPolicy ¶
NewFixedIntervalPolicy returns a fixed interval policy
func NewNullPolicy ¶
func NewNullPolicy() Policy
NewNullPolicy does not do any backoff. It always allows the caller to execute dial.
Click to show internal directories.
Click to hide internal directories.