Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Backoff ¶
type Backoff struct {
// contains filtered or unexported fields
}
Backoff implements exponential backoff with randomized wait times
func (*Backoff) Err ¶
Err returns the reason for terminating the backoff, or nil if it didn't terminate.
func (*Backoff) ErrCause ¶
ErrCause is like Err() but returns the context cause if backoff is terminated because the context has been canceled.
func (*Backoff) NumRetries ¶
NumRetries returns the number of retries so far
type Config ¶
type Config struct { MinBackoff time.Duration `yaml:"min_period" category:"advanced"` // start backoff at this level MaxBackoff time.Duration `yaml:"max_period" category:"advanced"` // increase exponentially to this level MaxRetries int `yaml:"max_retries" category:"advanced"` // give up after this many; zero means infinite retries }
Config configures a Backoff
Click to show internal directories.
Click to hide internal directories.