public class ItemFastSlowRateLimiter<T> extends java.lang.Object implements RateLimiter<T>
Constructor and Description |
---|
ItemFastSlowRateLimiter(java.time.Duration fastDelay,
java.time.Duration slowDelay,
int maxFastAttempts) |
Modifier and Type | Method and Description |
---|---|
void |
forget(T item)
Forget indicates that an item is finished being retried.
|
int |
numRequeues(T item) |
java.time.Duration |
when(T item)
When gets an item and gets to decide how long that item should wait
|
public ItemFastSlowRateLimiter(java.time.Duration fastDelay, java.time.Duration slowDelay, int maxFastAttempts)
public java.time.Duration when(T item)
RateLimiter
when
in interface RateLimiter<T>
item
- Item that should waitpublic void forget(T item)
RateLimiter
forget
in interface RateLimiter<T>
item
- Item will be forgetpublic int numRequeues(T item)
numRequeues
in interface RateLimiter<T>
Copyright © 2020. All rights reserved.