object Throttler
- Source
- TimerBasedThrottler.scala
- See also
- Alphabetic
- By Inheritance
- Throttler
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
-
final
case class
Rate
(numberOfCalls: Int, duration: FiniteDuration) extends Product with Serializable
A rate used for throttling.
A rate used for throttling.
Scala API: There are some shorthands available to construct rates:
import java.util.concurrent.TimeUnit._ import scala.concurrent.duration.{ Duration, FiniteDuration } val rate1 = 1 msgsPer (1, SECONDS) val rate2 = 1 msgsPer Duration(1, SECONDS) val rate3 = 1 msgsPer (1 seconds) val rate4 = 1 msgsPerSecond val rate5 = 1 msgsPerMinute val rate6 = 1 msgsPerHour
- numberOfCalls
the number of calls that may take place in a period
- duration
the length of the period
- See also
-
implicit final
class
RateInt
extends AnyVal
Helper for some syntactic sugar.
Helper for some syntactic sugar.
-
final
case class
SetRate
(rate: Rate) extends Product with Serializable
Set the rate of a throttler.
Set the rate of a throttler.
You may change a throttler's rate at any time.
- rate
the rate at which messages will be delivered to the target of the throttler
-
final
case class
SetTarget
(target: Option[ActorRef]) extends Product with Serializable
Set the target of a throttler.
Set the target of a throttler.
You may change a throttler's target at any time.
Notice that the messages sent by the throttler to the target will have the original sender (and not the throttler) as the sender. (In Akka terms, the throttler
forward
s the message.)- target
if
target
isNone
, the throttler will stop delivering messages and the messages already received but not yet delivered, as well as any messages received in the future will be queued and eventually be delivered when a new target is set. Iftarget
is notNone
, the currently queued messages as well as any messages received in the future will be delivered to the new target at a rate not exceeding the current throttler's rate.
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )