Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrHandlerRetrying = fmt.Errorf("retry handler is retrying")
View Source
var ErrRetriesExceeded = fmt.Errorf("maximum retry exceeded")
Functions ¶
This section is empty.
Types ¶
type BackoffHandler ¶
type BackoffHandler interface { // NextDelay returns the delay for next retry or error if maximum number of retries exceeded. NextDelay() (time.Duration, error) // ResetDelay resets the retry delay ResetDelay() // DecreaseDelay returns the decreased delay for next retry DecreaseDelay() time.Duration }
BackoffHandler handles delays for back off retry
func NewExponentialBackoffHandler ¶
func NewExponentialBackoffHandler(maxRetries int, minRetryDelay, maxRetryDelay time.Duration) BackoffHandler
type RetryHandler ¶
type RetryHandler interface { // Retry triggers retry Retry() error // Reset resets handler internals Reset() }
RetryHandler encapsulates logic that handles retry
func NewDelayRetryHandler ¶
func NewDelayRetryHandler(retryFunc func(), backoff BackoffHandler) RetryHandler
Click to show internal directories.
Click to hide internal directories.