Class ThrottlerTransportAdapter.TokenBucket
java.lang.Object
org.apache.pekko.remote.transport.ThrottlerTransportAdapter.TokenBucket
- All Implemented Interfaces:
Serializable
,NoSerializationVerificationNeeded
,ThrottlerTransportAdapter.ThrottleMode
,scala.Equals
,scala.Product
- Enclosing class:
- ThrottlerTransportAdapter
public static final class ThrottlerTransportAdapter.TokenBucket
extends Object
implements ThrottlerTransportAdapter.ThrottleMode, scala.Product, Serializable
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionTokenBucket
(int capacity, double tokensPerSecond, long nanoTimeOfLastSend, int availableTokens) -
Method Summary
Modifier and TypeMethodDescriptionint
boolean
int
capacity()
copy
(int capacity, double tokensPerSecond, long nanoTimeOfLastSend, int availableTokens) int
double
long
int
boolean
int
hashCode()
long
int
productElement
(int x$1) productElementName
(int x$1) scala.collection.Iterator<Object>
scala.concurrent.duration.FiniteDuration
timeToAvailable
(long currentNanoTime, int tokens) double
toString()
scala.Tuple2<ThrottlerTransportAdapter.ThrottleMode,
Object> tryConsumeTokens
(long nanoTimeOfSend, int tokens) Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface scala.Product
productElementNames
-
Constructor Details
-
TokenBucket
public TokenBucket(int capacity, double tokensPerSecond, long nanoTimeOfLastSend, int availableTokens)
-
-
Method Details
-
capacity
public int capacity() -
tokensPerSecond
public double tokensPerSecond() -
nanoTimeOfLastSend
public long nanoTimeOfLastSend() -
availableTokens
public int availableTokens() -
tryConsumeTokens
public scala.Tuple2<ThrottlerTransportAdapter.ThrottleMode,Object> tryConsumeTokens(long nanoTimeOfSend, int tokens) - Specified by:
tryConsumeTokens
in interfaceThrottlerTransportAdapter.ThrottleMode
-
timeToAvailable
public scala.concurrent.duration.FiniteDuration timeToAvailable(long currentNanoTime, int tokens) - Specified by:
timeToAvailable
in interfaceThrottlerTransportAdapter.ThrottleMode
-
copy
public ThrottlerTransportAdapter.TokenBucket copy(int capacity, double tokensPerSecond, long nanoTimeOfLastSend, int availableTokens) -
copy$default$1
public int copy$default$1() -
copy$default$2
public double copy$default$2() -
copy$default$3
public long copy$default$3() -
copy$default$4
public int copy$default$4() -
productPrefix
- Specified by:
productPrefix
in interfacescala.Product
-
productArity
public int productArity()- Specified by:
productArity
in interfacescala.Product
-
productElement
- Specified by:
productElement
in interfacescala.Product
-
productIterator
- Specified by:
productIterator
in interfacescala.Product
-
canEqual
- Specified by:
canEqual
in interfacescala.Equals
-
productElementName
- Specified by:
productElementName
in interfacescala.Product
-
hashCode
public int hashCode() -
toString
-
equals
-