Documentation ¶
Index ¶
- func NewCustomAppControllerRateLimiter[T comparable](cfg *AppControllerRateLimiterConfig) workqueue.TypedRateLimiter[T]
- func NewItemExponentialRateLimiterWithAutoReset[T comparable](baseDelay, maxDelay, failureCoolDown time.Duration, backoffFactor float64) workqueue.TypedRateLimiter[T]
- type AppControllerRateLimiterConfig
- type ItemExponentialRateLimiterWithAutoReset
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewCustomAppControllerRateLimiter ¶
func NewCustomAppControllerRateLimiter[T comparable](cfg *AppControllerRateLimiterConfig) workqueue.TypedRateLimiter[T]
NewCustomAppControllerRateLimiter is a constructor for the rate limiter for a workqueue used by app controller. It has both overall and per-item rate limiting. The overall is a token bucket and the per-item is exponential(with auto resets)
func NewItemExponentialRateLimiterWithAutoReset ¶
func NewItemExponentialRateLimiterWithAutoReset[T comparable](baseDelay, maxDelay, failureCoolDown time.Duration, backoffFactor float64) workqueue.TypedRateLimiter[T]
Types ¶
type AppControllerRateLimiterConfig ¶
type AppControllerRateLimiterConfig struct { BucketSize int64 BucketQPS float64 FailureCoolDown time.Duration BaseDelay time.Duration MaxDelay time.Duration BackoffFactor float64 }
func GetDefaultAppRateLimiterConfig ¶
func GetDefaultAppRateLimiterConfig() *AppControllerRateLimiterConfig
type ItemExponentialRateLimiterWithAutoReset ¶
type ItemExponentialRateLimiterWithAutoReset[T comparable] struct { // contains filtered or unexported fields }
ItemExponentialRateLimiterWithAutoReset does a simple baseDelay*2^<num-failures> limit dealing with max failures and expiration/resets are up dependent on the cooldown period
func (*ItemExponentialRateLimiterWithAutoReset[T]) Forget ¶
func (r *ItemExponentialRateLimiterWithAutoReset[T]) Forget(item T)
func (*ItemExponentialRateLimiterWithAutoReset[T]) NumRequeues ¶
func (r *ItemExponentialRateLimiterWithAutoReset[T]) NumRequeues(item T) int
func (*ItemExponentialRateLimiterWithAutoReset[T]) When ¶
func (r *ItemExponentialRateLimiterWithAutoReset[T]) When(item T) time.Duration
Click to show internal directories.
Click to hide internal directories.