Documentation ¶
Overview ¶
Package retry implements exponential retry policy.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithExponentialBackoff ¶
func WithExponentialBackoff(desc string, attempt AttemptFunc, isRetriableError IsRetriableFunc) (interface{}, error)
WithExponentialBackoff runs the provided attempt until it succeeds, retrying on all errors that are deemed retriable by the provided function. The delay between retries grows exponentially up to a certain limit.
Types ¶
type AttemptFunc ¶
type AttemptFunc func() (interface{}, error)
AttemptFunc performs an attempt and returns a value (optional, may be nil) and an error.
type IsRetriableFunc ¶
IsRetriableFunc is a function that determines whether an error is retriable.
Click to show internal directories.
Click to hide internal directories.