Did this page help you?

   Yes   No   Tell us about it...

com.amazonaws.services.simpleworkflow.flow.worker
Class Throttler

java.lang.Object
  extended by com.amazonaws.services.simpleworkflow.flow.worker.Throttler

public class Throttler
extends Object


Constructor Summary
Throttler(String name, double maxRatePerSecond, long rateIntervalMilliseconds)
          Construct throttler.
 
Method Summary
 void setMaxRatePerSecond(double maxRatePerSecond)
           
 void throttle()
          When called on each request sleeps if called faster then configured average rate.
 void throttle(int count)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Throttler

public Throttler(String name,
                 double maxRatePerSecond,
                 long rateIntervalMilliseconds)
Construct throttler.

Parameters:
name - Human readable name of the resource being throttled. Used for logging only.
maxRatePerSecond - maximum rate allowed
rateIntervalMilliseconds - rate measurement interval. Interval should be at least 1000 / maxRatePerSecond.
Method Detail

setMaxRatePerSecond

public void setMaxRatePerSecond(double maxRatePerSecond)

throttle

public void throttle(int count)
              throws InterruptedException
Throws:
InterruptedException

throttle

public void throttle()
              throws InterruptedException
When called on each request sleeps if called faster then configured average rate.

Throws:
InterruptedException - when interrupted


Copyright © 2010 Amazon Web Services, Inc. All Rights Reserved.