public class RecyclableRateLimiterImpl extends com.google.common.util.concurrent.RateLimiter implements RecyclableRateLimiter
| Modifier and Type | Method and Description |
|---|---|
static RecyclableRateLimiter |
create(double permitsPerSecond,
double maxBurstSeconds)
Create a new rate limiter instance with specified burst window.
|
boolean |
immediatelyAvailable(int permits)
Checks whether there's enough permits accumulated to cover the number of requested permits.
|
void |
recyclePermits(int permits)
Return the specified number of permits back to the pool
|
acquire, acquire, create, create, getRate, setRate, toString, tryAcquire, tryAcquire, tryAcquire, tryAcquireclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitacquire, acquire, getRate, setRate, tryAcquire, tryAcquirepublic static RecyclableRateLimiter create(double permitsPerSecond, double maxBurstSeconds)
permitsPerSecond - the rate of the returned rate limiter, in permits per second.maxBurstSeconds - time window (in seconds) to accumulate unused permits for.public boolean immediatelyAvailable(int permits)
immediatelyAvailable in interface RecyclableRateLimiterpermits - permits to checkpublic void recyclePermits(int permits)
recyclePermits in interface RecyclableRateLimiterpermits - number of permits to returnCopyright © 2020. All rights reserved.