final case class TokenBucket(capacity: Int, tokensPerSecond: Double, nanoTimeOfLastSend: Long, availableTokens: Int) extends ThrottleMode with Product with Serializable
- Annotations
- @SerialVersionUID()
- Source
- ThrottlerTransportAdapter.scala
Linear Supertypes
Type Hierarchy
Ordering
- Alphabetic
- By Inheritance
Inherited
- TokenBucket
- Serializable
- Serializable
- Product
- Equals
- ThrottleMode
- NoSerializationVerificationNeeded
- AnyRef
- Any
Implicitly
- by any2stringadd
- by StringFormat
- by Ensuring
- by ArrowAssoc
- Hide All
- Show All
Visibility
- Public
- All
Instance Constructors
Value Members
- val availableTokens: Int
- val capacity: Int
- val nanoTimeOfLastSend: Long
-
def
timeToAvailable(currentNanoTime: Long, tokens: Int): FiniteDuration
- Definition Classes
- TokenBucket → ThrottleMode
- val tokensPerSecond: Double
-
def
tryConsumeTokens(nanoTimeOfSend: Long, tokens: Int): (ThrottleMode, Boolean)
- Definition Classes
- TokenBucket → ThrottleMode