Packages

object Throttler

Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Throttler
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. 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

    akka.contrib.throttle.Throttler

  2. implicit final class RateInt extends AnyVal

    Helper for some syntactic sugar.

    Helper for some syntactic sugar.

    See also

    akka.contrib.throttle.Throttler.Rate

  3. 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

  4. 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 forwards the message.)

    target

    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.