A simple Hierarchical Timing Wheels timer implementation 'copy' from kafka and rewrite with java from scala, so we can use it both in scala and java.
Related resources:
<dependency>
<groupId>com.infilos</groupId>
<artifactId>relax-timer</artifactId>
<version>LATEST</version>
</dependency>
And, add a binding for slf4j:
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>LATEST</version>
</dependency>
And then create time instance and submit tasks:
Timer timer = Timer.create("test-timer").startup();
// print "run..." after 2 seconds
timer.submit(new Runnable() {
@Override
public void run() {
System.out.println("run...");
}
}, 2000L);
- Snapshot:
mvn clean deploy
- Release:
mvn clean package source:jar gpg:sign install:install deploy:deploy