Package akka.remote.testkit
Class TokenBucket
- java.lang.Object
-
- akka.remote.testkit.TokenBucket
-
- All Implemented Interfaces:
NoSerializationVerificationNeeded
,ThrottleMode
,java.io.Serializable
,scala.Equals
,scala.Product
public final class TokenBucket extends java.lang.Object implements ThrottleMode, scala.Product, java.io.Serializable
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description TokenBucket(int capacity, double tokensPerSecond, long nanoTimeOfLastSend, int availableTokens)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static TokenBucket
apply(int capacity, double tokensPerSecond, long nanoTimeOfLastSend, int availableTokens)
int
availableTokens()
boolean
canEqual(java.lang.Object x$1)
int
capacity()
TokenBucket
copy(int capacity, double tokensPerSecond, long nanoTimeOfLastSend, int availableTokens)
int
copy$default$1()
double
copy$default$2()
long
copy$default$3()
int
copy$default$4()
boolean
equals(java.lang.Object x$1)
int
hashCode()
long
nanoTimeOfLastSend()
int
productArity()
java.lang.Object
productElement(int x$1)
java.lang.String
productElementName(int x$1)
scala.collection.Iterator<java.lang.Object>
productIterator()
java.lang.String
productPrefix()
scala.concurrent.duration.FiniteDuration
timeToAvailable(long currentNanoTime, int tokens)
double
tokensPerSecond()
java.lang.String
toString()
scala.Tuple2<ThrottleMode,java.lang.Object>
tryConsumeTokens(long nanoTimeOfSend, int tokens)
static scala.Option<scala.Tuple4<java.lang.Object,java.lang.Object,java.lang.Object,java.lang.Object>>
unapply(TokenBucket x$0)
-
-
-
Method Detail
-
apply
public static TokenBucket apply(int capacity, double tokensPerSecond, long nanoTimeOfLastSend, int availableTokens)
-
unapply
public static scala.Option<scala.Tuple4<java.lang.Object,java.lang.Object,java.lang.Object,java.lang.Object>> unapply(TokenBucket x$0)
-
capacity
public int capacity()
-
tokensPerSecond
public double tokensPerSecond()
-
nanoTimeOfLastSend
public long nanoTimeOfLastSend()
-
availableTokens
public int availableTokens()
-
tryConsumeTokens
public scala.Tuple2<ThrottleMode,java.lang.Object> tryConsumeTokens(long nanoTimeOfSend, int tokens)
- Specified by:
tryConsumeTokens
in interfaceThrottleMode
-
timeToAvailable
public scala.concurrent.duration.FiniteDuration timeToAvailable(long currentNanoTime, int tokens)
- Specified by:
timeToAvailable
in interfaceThrottleMode
-
copy
public 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
public java.lang.String productPrefix()
- Specified by:
productPrefix
in interfacescala.Product
-
productArity
public int productArity()
- Specified by:
productArity
in interfacescala.Product
-
productElement
public java.lang.Object productElement(int x$1)
- Specified by:
productElement
in interfacescala.Product
-
productIterator
public scala.collection.Iterator<java.lang.Object> productIterator()
- Specified by:
productIterator
in interfacescala.Product
-
canEqual
public boolean canEqual(java.lang.Object x$1)
- Specified by:
canEqual
in interfacescala.Equals
-
productElementName
public java.lang.String productElementName(int x$1)
- Specified by:
productElementName
in interfacescala.Product
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object x$1)
- Specified by:
equals
in interfacescala.Equals
- Overrides:
equals
in classjava.lang.Object
-
-