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
the number of calls that may take place in a period
the length of the period
Helper for some syntactic sugar.
Helper for some syntactic sugar.
Set the rate of a throttler.
Set the rate of a throttler.
You may change a throttler's rate at any time.
the rate at which messages will be delivered to the target of the throttler
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.)
if target
is None
, 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. If target
is not None
, 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.
(Since version 2.5.0) Use streams, see migration guide
akka.contrib.throttle.Throttler.SetTarget
akka.contrib.throttle.Throttler.SetRate
akka.contrib.throttle.Throttler.Rate
akka.contrib.throttle.TimerBasedThrottler