| Constructor and Description |
|---|
RateThrottle(double rateLimit) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
tryAcquire(X item)
Request a permit about a thing
|
int |
tryAcquire(X item,
int requiredCount)
Request permits about a set of things
|
public RateThrottle(double rateLimit)
rateLimit - The rate (permits/sec) limit for the permitspublic final boolean tryAcquire(X item)
ThrottletryAcquire in interface Throttle<X>item - the subject of the permitpublic final int tryAcquire(X item, int requiredCount)
ThrottletryAcquire in interface Throttle<X>item - the subject of the permitsrequiredCount - how many permits is requested