public final class GuavaRateLimiter extends Object implements PermitSupplier
| Constructor and Description |
|---|
GuavaRateLimiter(com.google.common.util.concurrent.RateLimiter limiter) |
| Modifier and Type | Method and Description |
|---|---|
com.google.common.util.concurrent.RateLimiter |
getLimiter() |
String |
toString() |
boolean |
tryAcquire(int nrPermits,
long deadlineNanos) |
boolean |
tryAcquire(int nrPermits,
long timeout,
TimeUnit unit)
try to acquire a number of permits.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitacquire, acquire, toSemaphore, tryAcquirepublic GuavaRateLimiter(com.google.common.util.concurrent.RateLimiter limiter)
public boolean tryAcquire(int nrPermits,
long deadlineNanos)
throws InterruptedException
tryAcquire in interface PermitSupplierInterruptedExceptionpublic boolean tryAcquire(int nrPermits,
long timeout,
TimeUnit unit)
throws InterruptedException
PermitSuppliertryAcquire in interface PermitSuppliernrPermits - number of permits to acquire.timeout - time to wait for permits to become available.unit - units of time.InterruptedException - - operation interrupted.public com.google.common.util.concurrent.RateLimiter getLimiter()
Copyright © 2018 SPF4J. All rights reserved.