Interface RateGate
- All Known Implementing Classes:
- CombinedRateGate,- NullRateGate,- RateGateBase,- SimpleRateGate
public interface RateGate
- 
Method SummaryModifier and TypeMethodDescriptionorg.joda.time.DurationApproximately how long will I have to wait?org.joda.time.DurationhowLongToWait(int amount) Approximately how long will I have to wait?voidsetListener(RateGateListener listener) Set the event listenervoidBlock when configured rate-limits are exceeded.voidwaitToProceed(int amount) Block when configured rate-limits are exceeded.booleanwaitToProceed(int amount, org.joda.time.Duration wait) Block when configured rate-limits are exceeded.booleanwaitToProceed(org.joda.time.Duration wait) Block when configured rate-limits are exceeded.
- 
Method Details- 
waitToProceedBlock when configured rate-limits are exceeded.- Throws:
- InterruptedException- when somebody interrupted the waiting
 
- 
waitToProceedBlock when configured rate-limits are exceeded.- Parameters:
- wait- - the maximum amount of time to wait, negative means infinity
- Returns:
- true when we passed the gate; false when a timeout occurred
- Throws:
- InterruptedException- when somebody interrupted the waiting
 
- 
waitToProceedBlock when configured rate-limits are exceeded.- Parameters:
- amount- - number of elements
- Throws:
- InterruptedException- when somebody interrupted the waiting
 
- 
waitToProceedBlock when configured rate-limits are exceeded.- Parameters:
- amount- - number of elements
- wait- - the maximum amount of time to wait, negative means infinity
- Returns:
- true when we passed the gate; false when a timeout occurred
- Throws:
- InterruptedException- when somebody interrupted the waiting
 
- 
howLongToWaitorg.joda.time.Duration howLongToWait()Approximately how long will I have to wait?- Returns:
- - a non-negative amount of time, zero means no need to wait.
 
- 
howLongToWaitorg.joda.time.Duration howLongToWait(int amount) Approximately how long will I have to wait?- Parameters:
- amount- - number of elements
- Returns:
- - a non-negative amount of time, zero means no need to wait.
 
- 
setListenerSet the event listener- Parameters:
- listener- - new listener
 
 
-