Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrMaxRetryAttempts = errors.New("max retry attempts reached")
ErrMaxRetryAttempts returned when max retry attempts reached
Functions ¶
This section is empty.
Types ¶
type RetryRateLimitCaller ¶
type RetryRateLimitCaller struct {
// Underling caller
Caller telegoapi.Caller
// Max number of attempts to make a call
MaxAttempts int
// Exponent base for delay
ExponentBase float64
// Starting delay duration
StartDelay time.Duration
// Maximum delay duration
MaxDelay time.Duration
// Rate limit behavior
RateLimit telegoapi.RetryRateLimit
// Buffer request data, if set to true requests that usually stream body using io.Reader will be buffered
// to support retrying such requests
//
// Warning: Enabling this may lead to excessive memory consumption and OOMKill
BufferRequestData bool
}
RetryRateLimitCaller decorator over [Caller] that provides retries with exponential backoff on rate limit errors Depending on [RetryRateLimit] will wait for rate limit timeout to reset or abort, defaults to do nothing Delay = min((ExponentBase ^ AttemptNumber) * StartDelay, MaxDelay)
Click to show internal directories.
Click to hide internal directories.