Interface RateLimitingQueue<T>

Type Parameters:
T - item type
All Superinterfaces:
DelayingQueue<T>, WorkQueue<T>
All Known Implementing Classes:
DefaultRateLimitingQueue

public interface RateLimitingQueue<T> extends DelayingQueue<T>
Defines a queue that rate limits items being added to the queue.

The code has been copied from the official client and modified: RateLimitingQueue

  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Adds an item to the work queue after the rate limiter says it is ok.
    void
    forget(T item)
    Indicates that an item is finished being retried.
    int
    numRequeues(T item)
    Returns back how many times the item was requeued.

    Methods inherited from interface io.micronaut.kubernetes.client.openapi.operator.workqueue.DelayingQueue

    addAfter

    Methods inherited from interface io.micronaut.kubernetes.client.openapi.operator.workqueue.WorkQueue

    add, done, get, isShutdown, length, shutdown, start
  • Method Details

    • addRateLimited

      void addRateLimited(@NonNull T item)
      Adds an item to the work queue after the rate limiter says it is ok.
      Parameters:
      item - item to add
    • forget

      void forget(@NonNull T item)
      Indicates that an item is finished being retried. Doesn't matter whether it is for perm failing or for success, we'll stop the rate limiter from tracking it. This only clears the `rateLimiter`, you still have to call `Done` on the queue.
      Parameters:
      item - item which is finished being retried
    • numRequeues

      int numRequeues(@NonNull T item)
      Returns back how many times the item was requeued.
      Parameters:
      item - specific item
      Returns:
      number of times the item was requeued