Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Exponential ¶
type Exponential struct { // Min is the minimal backoff time, if unspecified, 1 second will be // used Min time.Duration // Max is the maximum backoff time, if unspecified, no maximum time is // applied Max time.Duration // Factor is the factor the backoff time grows exponentially, if // unspecified, a factor of 2.0 will be used Factor float64 // Jitter, when enabled, adds random jitter to the interval Jitter bool // NodeManager enables the use of cluster size dependent backoff // intervals, i.e. the larger the cluster, the longer the backoff // interval NodeManager NodeManager // Name is a free form string describing the operation subject to the // backoff, if unspecified, a UUID is generated. This string is used // for logging purposes. Name string // ResetAfter will reset the exponential back-off if no attempt is made for the amount of time specified here. // Needs to be larger than the Max duration, otherwise it will be ignored to avoid accidental resets. // If unspecified, no reset is performed. ResetAfter time.Duration // contains filtered or unexported fields }
Exponential implements an exponential backoff
type NodeManager ¶
type NodeManager interface {
ClusterSizeDependantInterval(baseInterval time.Duration) time.Duration
}
NodeManager is the interface required to implement cluster size dependent intervals
func NewNodeManager ¶
func NewNodeManager(clusterSizeDependantInterval func(baseInterval time.Duration) time.Duration) NodeManager
NewNodeManager returns a new NodeManager implementing cluster size dependent intervals based on the given function. If the function is nil, then no tuning is performed.
Click to show internal directories.
Click to hide internal directories.