akka.remote.transport
Class ThrottlerTransportAdapter.TokenBucket
java.lang.Object
akka.remote.transport.ThrottlerTransportAdapter.TokenBucket
- All Implemented Interfaces:
- NoSerializationVerificationNeeded, ThrottlerTransportAdapter.ThrottleMode, java.io.Serializable, scala.Equals, scala.Product
- Enclosing class:
- ThrottlerTransportAdapter
public static class ThrottlerTransportAdapter.TokenBucket
- extends java.lang.Object
- implements ThrottlerTransportAdapter.ThrottleMode, scala.Product, scala.Serializable
- See Also:
- Serialized Form
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface scala.Product |
productArity, productElement, productIterator, productPrefix |
Methods inherited from interface scala.Equals |
canEqual, equals |
ThrottlerTransportAdapter.TokenBucket
public ThrottlerTransportAdapter.TokenBucket(int capacity,
double tokensPerSecond,
long nanoTimeOfLastSend,
int availableTokens)
capacity
public int capacity()
tokensPerSecond
public double tokensPerSecond()
nanoTimeOfLastSend
public long nanoTimeOfLastSend()
availableTokens
public int availableTokens()
tryConsumeTokens
public scala.Tuple2<ThrottlerTransportAdapter.ThrottleMode,java.lang.Object> tryConsumeTokens(long nanoTimeOfSend,
int tokens)
- Specified by:
tryConsumeTokens
in interface ThrottlerTransportAdapter.ThrottleMode
timeToAvailable
public scala.concurrent.duration.FiniteDuration timeToAvailable(long currentNanoTime,
int tokens)
- Specified by:
timeToAvailable
in interface ThrottlerTransportAdapter.ThrottleMode