Class HeartbeatManager
java.lang.Object
com.webfirmframework.wffweb.server.page.HeartbeatManager
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 Summary
ConstructorDescriptionHeartbeatManager
(long minInterval, Runnable task) HeartbeatManager
(Executor executor, long minInterval, Runnable task) -
Method Summary
Modifier and TypeMethodDescriptionvoid
runAsync()
Runs the task given in the constructor in an asynchronous mode.
-
Constructor Details
-
HeartbeatManager
- 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
- 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
-