Class HeartbeatManager

java.lang.Object
com.webfirmframework.wffweb.server.page.HeartbeatManager

public final class HeartbeatManager extends Object
It makes sure that the task is invoked only once in the specified interval of time even if the runAsync() methods is called by multiple threads less than the interval of specified time.
Since:
3.0.15
  • Constructor Details

    • HeartbeatManager

      public HeartbeatManager(Executor executor, long minInterval, Runnable task)
      Parameters:
      executor - the executor object to use thread from it.
      minInterval - in milliseconds. It keeps the minimum interval between the task execution.
      task - the Runnable object which makes a request with sessionid to the heartbeat url for keeping http session alive.
    • HeartbeatManager

      public HeartbeatManager(long minInterval, Runnable task)
      Parameters:
      minInterval - in milliseconds. It keeps the minimum interval between the task execution.
      task - the Runnable object which makes a request with sessionid to the heartbeat url for keeping http session alive.
  • Method Details

    • runAsync

      public void runAsync()
      Runs the task given in the constructor in an asynchronous mode.
      Since:
      3.0.15