public static final class ThrottlerTransportAdapter.TokenBucket extends java.lang.Object implements ThrottlerTransportAdapter.ThrottleMode, scala.Product, scala.Serializable
Constructor and Description |
---|
TokenBucket(int capacity,
double tokensPerSecond,
long nanoTimeOfLastSend,
int availableTokens) |
Modifier and Type | Method and Description |
---|---|
int |
availableTokens() |
int |
capacity() |
long |
nanoTimeOfLastSend() |
scala.concurrent.duration.FiniteDuration |
timeToAvailable(long currentNanoTime,
int tokens) |
double |
tokensPerSecond() |
scala.Tuple2<ThrottlerTransportAdapter.ThrottleMode,java.lang.Object> |
tryConsumeTokens(long nanoTimeOfSend,
int tokens) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public TokenBucket(int capacity, double tokensPerSecond, long nanoTimeOfLastSend, int availableTokens)
public int capacity()
public double tokensPerSecond()
public long nanoTimeOfLastSend()
public int availableTokens()
public scala.Tuple2<ThrottlerTransportAdapter.ThrottleMode,java.lang.Object> tryConsumeTokens(long nanoTimeOfSend, int tokens)
tryConsumeTokens
in interface ThrottlerTransportAdapter.ThrottleMode
public scala.concurrent.duration.FiniteDuration timeToAvailable(long currentNanoTime, int tokens)
timeToAvailable
in interface ThrottlerTransportAdapter.ThrottleMode