Documentation ¶
Index ¶
Constants ¶
const (
// MaxRetries is the number of times we try to process a given key before permanently forgetting it.
MaxRetries = 20
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ItemHandler ¶
ItemHandler is a callback that handles a single key on the Queue
type Queue ¶
type Queue struct {
// contains filtered or unexported fields
}
Queue implements a wrapper around workqueue with native VK instrumentation
func New ¶
func New(ratelimiter workqueue.RateLimiter, name string, handler ItemHandler) *Queue
New creates a queue
It expects to get a item rate limiter, and a friendly name which is used in logs, and in the internal kubernetes metrics.
func (*Queue) Empty ¶
Empty returns if the queue has no items in it
It should only be used for debugging, as delayed items are not counted, leading to confusion
func (*Queue) EnqueueAfter ¶
EnqueueAfter enqueues the item after this period
Since it wrap workqueue semantics, if an item has been enqueued after, and it is immediately scheduled for work, it will process the immediate item, and then upon the latter delayed processing it will be processed again
func (*Queue) EnqueueWithoutRateLimit ¶
EnqueueWithoutRateLimit enqueues the key without a rate limit