public class RestartCounter
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
RestartCounter.State |
static class |
RestartCounter.State$ |
Constructor and Description |
---|
RestartCounter(int maxRestarts,
scala.concurrent.duration.FiniteDuration restartTimeout) |
Modifier and Type | Method and Description |
---|---|
int |
count()
Current number of restarts.
|
boolean |
restart()
Increment the restart counter, or reset the counter to 1 if the
restartTimeout has elapsed. |
public RestartCounter(int maxRestarts, scala.concurrent.duration.FiniteDuration restartTimeout)
public int count()
public final boolean restart()
restartTimeout
has elapsed. The latter also resets the timeout.true
if number of restarts, including this one, is less
than or equal to maxRestarts