Package com.google.api.client.util
Class BackOffUtils
- java.lang.Object
-
- com.google.api.client.util.BackOffUtils
-
@Beta public final class BackOffUtils extends java.lang.Object
- Since:
- 1.15
-
-
Constructor Summary
Constructors Modifier Constructor Description private
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 java.lang.InterruptedException, java.io.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:
java.lang.InterruptedException
- if any thread has interrupted the current threadjava.io.IOException
-
-