Class CombinedRateGate
java.lang.Object
com.sportradar.livedata.sdk.common.rategate.RateGateBase
com.sportradar.livedata.sdk.common.rategate.CombinedRateGate
- All Implemented Interfaces:
RateGate
-
Field Summary
Fields inherited from class com.sportradar.livedata.sdk.common.rategate.RateGateBase
listener, listenerLock -
Constructor Summary
ConstructorsConstructorDescriptionCombinedRateGate(RateGate... rateGates) Constuct a combined rategate.CombinedRateGate(RateGate r1, RateGate r2) Constuct a combined rategate. -
Method Summary
Modifier and TypeMethodDescriptionorg.joda.time.DurationhowLongToWait(int amount) Approximately how long will I have to wait?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.Methods inherited from class com.sportradar.livedata.sdk.common.rategate.RateGateBase
howLongToWait, setListener, waitToProceed, waitToProceedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.sportradar.livedata.sdk.common.rategate.RateGate
howLongToWait, setListener, waitToProceed, waitToProceed
-
Constructor Details
-
CombinedRateGate
Constuct a combined rategate.- Parameters:
rateGates- array ofRateGateto combine
-
CombinedRateGate
Constuct a combined rategate.- Parameters:
r1- - first rategater2- - second rategate
-
-
Method Details
-
waitToProceed
Description copied from interface:RateGateBlock when configured rate-limits are exceeded.- Specified by:
waitToProceedin interfaceRateGate- Parameters:
amount- - number of elements- Throws:
InterruptedException- when somebody interrupted the waiting
-
waitToProceed
Block when configured rate-limits are exceeded.- Specified by:
waitToProceedin interfaceRateGate- Specified by:
waitToProceedin classRateGateBase- Parameters:
amount- - number of elementswait- - when specified this means the maximum amount of time to wait- Returns:
- true when we passed the gate; false when a timeout occured
- Throws:
InterruptedException- when somebody interrupted the waiting
-
howLongToWait
public org.joda.time.Duration howLongToWait(int amount) Approximately how long will I have to wait?- Specified by:
howLongToWaitin interfaceRateGate- Specified by:
howLongToWaitin classRateGateBase- Parameters:
amount- - number of elements- Returns:
- - a non-negative amount of time, zero means no need to wait.
-