public final class LeakyBucket
extends java.lang.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 |
nextFillMs() |
long |
nextFillNs() |
long |
nextFillNs(long timeNs) |
long |
nextFillUs() |
void |
sleepWhileNotFillable() |
static LeakyBucket |
withLeakIntervalMs(long leakIntervalMs,
long capacity) |
static LeakyBucket |
withLeakIntervalNs(long leakIntervalNs,
long capacity) |
static LeakyBucket |
withLeakIntervalUs(long leakIntervalUs,
long capacity) |
static LeakyBucket |
withLeakPerSecond(double leakPerSecond,
long capacity) |
public static LeakyBucket withLeakPerSecond(double leakPerSecond, long capacity)
public static LeakyBucket withLeakIntervalMs(long leakIntervalMs, long capacity)
public static LeakyBucket withLeakIntervalUs(long leakIntervalUs, long capacity)
public static LeakyBucket withLeakIntervalNs(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 nextFillNs()
public long nextFillNs(long timeNs)
public long nextFillUs()
public long nextFillMs()
public void sleepWhileNotFillable()
throws java.lang.InterruptedException
java.lang.InterruptedExceptionCopyright © 2012. All Rights Reserved.