public class CombinedRateGate extends RateGateBase implements RateGate
Constructor and Description |
---|
CombinedRateGate(RateGate... rateGates)
Constuct a combined rategate.
|
CombinedRateGate(RateGate r1,
RateGate r2)
Constuct a combined rategate.
|
Modifier and Type | Method and Description |
---|---|
org.joda.time.Duration |
howLongToWait(int amount)
Approximately how long will I have to wait?
|
void |
waitToProceed(int amount)
Block when configured rate-limits are exceeded.
|
boolean |
waitToProceed(int amount,
org.joda.time.Duration wait)
Block when configured rate-limits are exceeded.
|
howLongToWait, setListener, waitToProceed, waitToProceed
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
howLongToWait, setListener, waitToProceed, waitToProceed
public CombinedRateGate(RateGate... rateGates)
rateGates
- public void waitToProceed(int amount) throws InterruptedException
RateGate
waitToProceed
in interface RateGate
amount
- - number of elementsInterruptedException
- when somebody interrupted the waitingpublic boolean waitToProceed(int amount, org.joda.time.Duration wait) throws InterruptedException
waitToProceed
in interface RateGate
waitToProceed
in class RateGateBase
amount
- - number of elementswait
- - when specified this means the maximum amount of time to waitInterruptedException
- when somebody interrupted the waitingpublic org.joda.time.Duration howLongToWait(int amount)
howLongToWait
in interface RateGate
howLongToWait
in class RateGateBase
amount
- - number of elementsCopyright © 2013–2023. All rights reserved.