Documentation
¶
Overview ¶
Package retry provides middlewares for retrying transient errors.
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrPermanent is returned when the error should not be retried. ErrPermanent = errors.New("[xkafka/retry] permanent error") )
Functions ¶
func ExponentialBackoff ¶
func ExponentialBackoff(opts ...Option) xkafka.MiddlewareFunc
ExponentialBackoff is a middleware with exponential backoff retry strategy. It retries the handler until the maximum number of retries or the maximum lifetime is reached. Default values: - MaxRetries: 100 - MaxDuration: 1 hour - Delay: 200 milliseconds - Jitter: 20 milliseconds - Multiplier: 1.5
Types ¶
type MaxDuration ¶
MaxDuration sets the maximum retry duration since the first execution.
type MaxRetries ¶
type MaxRetries int
MaxRetries sets the maximum number of retries. ErrRetryLimitExceeded is returned after exhausting all retries.
Click to show internal directories.
Click to hide internal directories.