|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Throttle
Throttle is an interface that supplies a throttle()
method, that can only be called at the rate specified
in a call to the setRate(float)
method. This can be used to restict processing to run at a certain number
of operations per second.
Responsibilities |
---|
Accept throttling rate in operations per second. |
Inject short pauses to fill-out processing cycles to a specified rate. |
Check against a throttle speed without waiting. |
Method Summary | |
---|---|
boolean |
checkThrottle()
Checks but does not enforce the throttle rate. |
void |
setRate(float hertz)
Specifies the throttling rate in operations per second. |
void |
throttle()
This method can only be called at the rate set by the setRate(float) method, if it is called faster than this
it will inject short pauses to restrict the call rate to that rate. |
Method Detail |
---|
void setRate(float hertz)
hertz
- The throttling rate in cycles per second.void throttle()
setRate(float)
method, if it is called faster than this
it will inject short pauses to restrict the call rate to that rate.
If the thread executing this method is interrupted, it must ensure that the threads interrupt thread
remains set upon exit from the method. This method does not expose InterruptedException, to indicate interruption
of the throttle during a timed wait. It may be changed so that it does.
boolean checkThrottle()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |