public final class LeakyBucket extends Object
| Modifier and Type | Method and Description |
|---|---|
long |
canFill() |
long |
canFill(long timeNs) |
void |
fill(long amount) |
void |
fill(long amount,
long timeNs) |
long |
getCapacity() |
long |
nextFillNano() |
long |
nextFillNano(long timeNs) |
void |
sleepWhileNotFillable() |
static LeakyBucket |
withLeakIntervalNano(long leakIntervalNs,
long capacity) |
static LeakyBucket |
withLeakPerSecond(double leakPerSecond,
long capacity) |
public static LeakyBucket withLeakPerSecond(double leakPerSecond, long capacity)
public static LeakyBucket withLeakIntervalNano(long leakIntervalNs, long capacity)
public long getCapacity()
public void fill(long amount)
public void fill(long amount,
long timeNs)
public long canFill()
public long canFill(long timeNs)
public long nextFillNano()
public long nextFillNano(long timeNs)
public void sleepWhileNotFillable()
throws InterruptedException
InterruptedExceptionCopyright © 2012. All Rights Reserved.