akka.contrib.throttle
Class Throttler.Rate

java.lang.Object
  extended by akka.contrib.throttle.Throttler.Rate
All Implemented Interfaces:
java.io.Serializable, scala.Equals, scala.Product
Enclosing class:
Throttler

public static class Throttler.Rate
extends java.lang.Object
implements scala.Product, scala.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
 

See Also:
Throttler, Serialized Form

Constructor Summary
Throttler.Rate(int numberOfCalls, scala.concurrent.duration.FiniteDuration duration)
           
 
Method Summary
 scala.concurrent.duration.FiniteDuration duration()
           
 long durationInMillis()
          The duration in milliseconds.
 int numberOfCalls()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface scala.Product
productArity, productElement, productIterator, productPrefix
 
Methods inherited from interface scala.Equals
canEqual, equals
 

Constructor Detail

Throttler.Rate

public Throttler.Rate(int numberOfCalls,
                      scala.concurrent.duration.FiniteDuration duration)
Method Detail

numberOfCalls

public int numberOfCalls()

duration

public scala.concurrent.duration.FiniteDuration duration()

durationInMillis

public long durationInMillis()
The duration in milliseconds.