org.erowid.sperowider
Class Throttle
java.lang.Object
org.erowid.sperowider.Throttle
- All Implemented Interfaces:
- IThrottle
- public class Throttle
- extends Object
- implements IThrottle
A concrete implementation of IThrottle
, this class
is constructed with the minimum number of milliseconds that must pass between
consecutive times that throttle()
will unblock.
- Version:
- $Header: /cvsroot/sperowider/SPEROWIDER_MODULE/javasource/org/erowid/sperowider/Throttle.java,v 1.5 2005/06/08 09:12:29 gurustu Exp $
- Author:
- Stu Statman
Constructor Summary |
Throttle(long delay)
Creates a new Throttle with a delay in milliseconds. |
Method Summary |
void |
throttle()
This method blocks until the set number of milliseconds has passed since the last
time this method returned. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Throttle
public Throttle(long delay)
- Creates a new Throttle with a delay in milliseconds.
- Parameters:
delay
-
throttle
public void throttle()
- This method blocks until the set number of milliseconds has passed since the last
time this method returned. Lots of threads could back up here, it will only let one
through at a time, throttling each.
- Specified by:
throttle
in interface IThrottle