Class RestartCounter


  • public class RestartCounter
    extends java.lang.Object
    INTERNAL API: Thread safe "restarts with duration" counter
    • Constructor Summary

      Constructors 
      Constructor Description
      RestartCounter​(int maxRestarts, scala.concurrent.duration.FiniteDuration restartTimeout)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int count()
      Current number of restarts.
      boolean restart()
      Increment the restart counter, or reset the counter to 1 if the restartTimeout has elapsed.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • RestartCounter

        public RestartCounter​(int maxRestarts,
                              scala.concurrent.duration.FiniteDuration restartTimeout)
    • Method Detail

      • count

        public int count()
        Current number of restarts.
      • restart

        public final boolean restart()
        Increment the restart counter, or reset the counter to 1 if the restartTimeout has elapsed. The latter also resets the timeout.
        Returns:
        true if number of restarts, including this one, is less than or equal to maxRestarts