Class Throttler
java.lang.Object
io.getunleash.util.Throttler
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidWe've had one successful call, so if we had 10 failures in a row, this will reduce the skips down to 9, so that we gradually start polling more often, instead of doing max load immediately after a sequence of errors.intintgetSkips()voidhandleHttpErrorCodes(int responseCode) voidWe've gotten the message to back off (usually a 429 or a 50x).voidWe've received an error code that we don't expect to change, which means we've already logged an ERROR.booleanvoidskipped()
-
Constructor Details
-
Throttler
-
-
Method Details
-
decrementFailureCountAndResetSkips
public void decrementFailureCountAndResetSkips()We've had one successful call, so if we had 10 failures in a row, this will reduce the skips down to 9, so that we gradually start polling more often, instead of doing max load immediately after a sequence of errors. -
increaseSkipCount
public void increaseSkipCount()We've gotten the message to back off (usually a 429 or a 50x). If we have successive failures, failure count here will be incremented higher and higher which will handle increasing our backoff, since we set the skip count to the failure count after every reset -
maximizeSkips
public void maximizeSkips()We've received an error code that we don't expect to change, which means we've already logged an ERROR. To avoid hammering the server that just told us we did something wrong and to avoid flooding the logs, we'll increase our skip count to maximum -
performAction
public boolean performAction() -
skipped
public void skipped() -
handleHttpErrorCodes
public void handleHttpErrorCodes(int responseCode) -
getSkips
public int getSkips() -
getFailures
public int getFailures()
-