ratelimit

package
v1.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 31, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultFastDelay       = 5 * time.Second
	DefaultSlowDelay       = 2 * time.Minute
	DefaultMaxFastAttempts = 300
)

Variables

This section is empty.

Functions

func DefaultFastSlow

func DefaultFastSlow() workqueue.TypedRateLimiter[ctrl.Request]

DefaultFastSlow is an untyped no-arg constructor for a workqueue's rate limiter that uses sigs.k8s.io/controller-runtime/pkg/reconcile.Request as a type argument. It has both overall and per-item rate limiting. The overall is a token bucket and the per-item is fast-slow.

func FastSlow

func FastSlow(fastDelay, slowDelay time.Duration, maxFastAttempts int) workqueue.TypedRateLimiter[ctrl.Request]

FastSlow is an untyped constructor for a workqueue's rate limiter that uses sigs.k8s.io/controller-runtime/pkg/reconcile.Request as a type argument. It has both overall and per-item rate limiting. The overall is a token bucket and the per-item is fast-slow.

func TypedFastSlow

func TypedFastSlow[T comparable](fastDelay, slowDelay time.Duration, maxFastAttempts int) workqueue.TypedRateLimiter[T]

TypedFastSlow is a typed constructor for a workqueue's rate limiter. It has both overall and per-item rate limiting. The overall is a token bucket and the per-item is fast-slow.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL