Package com.google.api.client.util
Class BackOffUtils
- java.lang.Object
-
- com.google.api.client.util.BackOffUtils
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method 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.
-
-
-
Method Detail
-
next
public static boolean next(Sleeper sleeper, BackOff backOff) throws InterruptedException, IOException
Runs the next iteration of the back-off policy, and returns whether to continue to retry the operation.If
true
, it will callSleeper.sleep(long)
with the specified number of milliseconds fromBackOff.nextBackOffMillis()
.- Parameters:
sleeper
- sleeperbackOff
- back-off policy- Returns:
- whether to continue to back off; in other words, whether
BackOff.nextBackOffMillis()
did not returnBackOff.STOP
- Throws:
InterruptedException
- if any thread has interrupted the current threadIOException
-
-