Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ErrorRetry ¶
type ErrorRetry struct {
// contains filtered or unexported fields
}
ErrorRetry is used to control the error retry logic.
func NewDefaultErrorRetry ¶
func NewDefaultErrorRetry() *ErrorRetry
NewDefaultErrorRetry creates a new ErrorRetry with default values.
func NewErrorRetry ¶
func NewErrorRetry( maxRetryDuration time.Duration, errGCInterval time.Duration, backoffBase int64, backoffMax int64, ) *ErrorRetry
NewErrorRetry creates a new ErrorRetry.
func NewInfiniteErrorRetry ¶
func NewInfiniteErrorRetry() *ErrorRetry
NewInfiniteErrorRetry creates a new ErrorRetry with infinite duration.
func (*ErrorRetry) GetRetryBackoff ¶
func (r *ErrorRetry) GetRetryBackoff(err error) (time.Duration, error)
GetRetryBackoff returns the backoff duration for retrying the last error. If the retry time is exhausted, it returns the an ChangefeedUnRetryableError.
type IsRetryable ¶
IsRetryable checks the error is safe or worth to retry, eg. "context.Canceled" better not retry
type Option ¶
type Option func(*retryOptions)
Option ...
func WithBackoffBaseDelay ¶
WithBackoffBaseDelay configures the initial delay, if delayInMs <= 0 "defaultBackoffBaseInMs" will be used
func WithBackoffMaxDelay ¶
WithBackoffMaxDelay configures the maximum delay, if delayInMs <= 0 "defaultBackoffCapInMs" will be used
func WithIsRetryableErr ¶
func WithIsRetryableErr(f IsRetryable) Option
WithIsRetryableErr configures the error should retry or not, if not set, retry by default
func WithMaxTries ¶
WithMaxTries configures maximum tries, if tries is 0, 1 will be used
func WithTotalRetryDuratoin ¶
WithTotalRetryDuratoin configures the total retry duration.