public final class BackOffUtils
extends java.lang.Object
BackOff
.
Note: This is copied from Google API client library to avoid its dependency.
Modifier and Type | Method and Description |
---|---|
static boolean |
next(Sleeper sleeper,
BackOff backOff)
Runs the next iteration of the back-off policy, and returns whether to continue to retry the
operation.
|
public static boolean next(Sleeper sleeper, BackOff backOff) throws java.lang.InterruptedException, java.io.IOException
If true
, it will call Sleeper.sleep(long)
with the specified number of
milliseconds from BackOff.nextBackOffMillis()
.
sleeper
- sleeperbackOff
- back-off policyBackOff.nextBackOffMillis()
did not return BackOff.STOP
java.lang.InterruptedException
- if any thread has interrupted the current threadjava.io.IOException