Class MaxOfRateLimiter<T>
java.lang.Object
io.micronaut.kubernetes.client.openapi.operator.workqueue.ratelimiter.MaxOfRateLimiter<T>
- Type Parameters:
T- item type
- All Implemented Interfaces:
RateLimiter<T>
Rate limiter which calls every provided rate limiter and returns the worst case response.
When used with a token bucket limiter, the burst could be apparently exceeded in cases
where particular items were separately delayed a longer time.
The code has been copied from the official client and modified: MaxOfRateLimiter
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidIndicates that an item is finished being retried (failed or succeeded).intnumRequeues(T item) Returns a number of failures that the item has had.voidreset()Resets the rate limiter.Decides how long an item should wait before adding it back to the queue.
-
Constructor Details
-
MaxOfRateLimiter
-
-
Method Details
-
when
Description copied from interface:RateLimiterDecides how long an item should wait before adding it back to the queue.- Specified by:
whenin interfaceRateLimiter<T>- Parameters:
item- an item that should wait- Returns:
- how long an item should wait before adding it back to the queue
-
forget
Description copied from interface:RateLimiterIndicates that an item is finished being retried (failed or succeeded).- Specified by:
forgetin interfaceRateLimiter<T>- Parameters:
item- an item to remove from internal tracking
-
numRequeues
Description copied from interface:RateLimiterReturns a number of failures that the item has had.- Specified by:
numRequeuesin interfaceRateLimiter<T>- Parameters:
item- an item- Returns:
- number of failures that the item has had
-
reset
public void reset()Description copied from interface:RateLimiterResets the rate limiter.- Specified by:
resetin interfaceRateLimiter<T>
-