Package io.nosqlbench.engine.api.metrics
Class PeriodicRunnable<T extends java.lang.Runnable>
java.lang.Object
io.nosqlbench.engine.api.metrics.PeriodicRunnable<T>
- All Implemented Interfaces:
java.lang.AutoCloseable,java.lang.Runnable
public class PeriodicRunnable<T extends java.lang.Runnable>
extends java.lang.Object
implements java.lang.Runnable, java.lang.AutoCloseable
This is a simple and light way to run a periodic task
-
Constructor Summary
Constructors Constructor Description PeriodicRunnable(long intervalMillis, T action) -
Method Summary
Modifier and Type Method Description voidclose()java.lang.ThreadgetThread()voidrun()PeriodicRunnable<T>startDaemonThread()PeriodicRunnable<T>startMainThread()
-
Constructor Details
-
Method Details
-
startDaemonThread
-
close
public void close()- Specified by:
closein interfacejava.lang.AutoCloseable
-
startMainThread
-
getThread
public java.lang.Thread getThread() -
run
public void run()- Specified by:
runin interfacejava.lang.Runnable
-