Class BackOffUtils

public final class BackOffUtils

Beta
Utilities for BackOff.

Inheritance

java.lang.Object > BackOffUtils

Static Methods

next(Sleeper sleeper, BackOff backOff)

public 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.

If true, it will call Sleeper#sleep(long) with the specified number of milliseconds from BackOff#nextBackOffMillis().

Parameters
NameDescription
sleeperSleeper

sleeper

backOffBackOff

back-off policy

Returns
TypeDescription
boolean

whether to continue to back off; in other words, whether BackOff#nextBackOffMillis() did not return BackOff#STOP

Exceptions
TypeDescription
InterruptedException

if any thread has interrupted the current thread

IOException

if any thread has interrupted the current thread