Class DefaultRateLimitingQueue<T>
java.lang.Object
io.micronaut.kubernetes.client.openapi.operator.workqueue.DefaultWorkQueue<T>
io.micronaut.kubernetes.client.openapi.operator.workqueue.DefaultDelayingQueue<T>
io.micronaut.kubernetes.client.openapi.operator.workqueue.DefaultRateLimitingQueue<T>
- Type Parameters:
T- item type
- All Implemented Interfaces:
DelayingQueue<T>,RateLimitingQueue<T>,WorkQueue<T>
public class DefaultRateLimitingQueue<T>
extends DefaultDelayingQueue<T>
implements RateLimitingQueue<T>
The default rate limiting queue implementation.
The code has been copied from the official client and modified: DefaultRateLimitingQueue
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultRateLimitingQueue(ExecutorService waitingWorker) DefaultRateLimitingQueue(ExecutorService waitingWorker, RateLimiter<T> rateLimiter) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddRateLimited(T item) Adds an item to the work queue after the rate limiter says it is ok.voidIndicates that an item is finished being retried.intnumRequeues(T item) Returns back how many times the item was requeued.voidshutdown()Initiates a shutdown of the work queue.Methods inherited from class io.micronaut.kubernetes.client.openapi.operator.workqueue.DefaultDelayingQueue
addAfter, startMethods inherited from class io.micronaut.kubernetes.client.openapi.operator.workqueue.DefaultWorkQueue
add, done, get, isShutdown, lengthMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.micronaut.kubernetes.client.openapi.operator.workqueue.DelayingQueue
addAfter
-
Constructor Details
-
DefaultRateLimitingQueue
-
DefaultRateLimitingQueue
-
-
Method Details
-
numRequeues
Description copied from interface:RateLimitingQueueReturns back how many times the item was requeued.- Specified by:
numRequeuesin interfaceRateLimitingQueue<T>- Parameters:
item- specific item- Returns:
- number of times the item was requeued
-
forget
Description copied from interface:RateLimitingQueueIndicates 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.- Specified by:
forgetin interfaceRateLimitingQueue<T>- Parameters:
item- item which is finished being retried
-
addRateLimited
Description copied from interface:RateLimitingQueueAdds an item to the work queue after the rate limiter says it is ok.- Specified by:
addRateLimitedin interfaceRateLimitingQueue<T>- Parameters:
item- item to add
-
shutdown
public void shutdown()Description copied from interface:WorkQueueInitiates a shutdown of the work queue. All added items whose processing not started will be ignored and removed from the queue.
-