Documentation ¶
Index ¶
Constants ¶
const (
Stop = backoff.Stop
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BackOff ¶
type BackOff = backoff.BackOff
BackOff type alias of "github.com/cenkalti/backoff/v4" BackOff, for better readability in importing
type Options ¶
type Options interface {
// contains filtered or unexported methods
}
Option allows customization of the backoff.ExponentialBackOff
func WithMaxElapsedTime ¶
WithMaxElapsedTime returns maxElapsedTime backoff option to override the MaxElapsedTime
func WithMaxInterval ¶
WithMaxInterval returns maxInterval backoff option to override the MaxInterval
type SizeLimitedBackOff ¶
type SizeLimitedBackOff interface { // NextBackOff returns the duration to wait before retrying the operation, // or backoff. NextBackOff() int // Success indicates the backoff implementation that previous request succeeded // so that it can adjust backoff accordingly for next request. Success() // Failure indicates the backoff implementation that previous request failed // so that it can adjust backoff accordingly for next request. Failure() // Reset to initial state. Reset() }
SizeLimitedBackOff defines interface for implementing a size based backoff for requests which contain number of records to be processed by server.
func NewSizeLimitedBackOff ¶
func NewSizeLimitedBackOff(maxRequestSize int) SizeLimitedBackOff
NewSizeLimitedBackOff returns a new SizeLimitedBackOff with provided maxRequestSize and lowest request size of 1. On Failure the size gets reduced by half and on Success size gets doubled