Packages

final case class Rate(numberOfCalls: Int, duration: FiniteDuration) extends Product with Serializable

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

Source
TimerBasedThrottler.scala
See also

akka.contrib.throttle.Throttler

Type Hierarchy
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Rate
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. AnyRef
  7. Any
Implicitly
  1. by any2stringadd
  2. by StringFormat
  3. by Ensuring
  4. by ArrowAssoc
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Rate(numberOfCalls: Int, duration: FiniteDuration)

    numberOfCalls

    the number of calls that may take place in a period

    duration

    the length of the period

Value Members

  1. val duration: FiniteDuration
  2. def durationInMillis(): Long

    The duration in milliseconds.

  3. val numberOfCalls: Int