relax-timer

A simple timer implementation.

License

License

GroupId

GroupId

com.infilos
ArtifactId

ArtifactId

relax-timer
Last Version

Last Version

0.1.0
Release Date

Release Date

Type

Type

jar
Description

Description

relax-timer
A simple timer implementation.
Project URL

Project URL

https://github.com/infilow/relax-timer
Source Code Management

Source Code Management

https://github.com/infilow/relax-timer/tree/master

Download relax-timer

How to add to project

<!-- https://jarcasting.com/artifacts/com.infilos/relax-timer/ -->
<dependency>
    <groupId>com.infilos</groupId>
    <artifactId>relax-timer</artifactId>
    <version>0.1.0</version>
</dependency>
// https://jarcasting.com/artifacts/com.infilos/relax-timer/
implementation 'com.infilos:relax-timer:0.1.0'
// https://jarcasting.com/artifacts/com.infilos/relax-timer/
implementation ("com.infilos:relax-timer:0.1.0")
'com.infilos:relax-timer:jar:0.1.0'
<dependency org="com.infilos" name="relax-timer" rev="0.1.0">
  <artifact name="relax-timer" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.infilos', module='relax-timer', version='0.1.0')
)
libraryDependencies += "com.infilos" % "relax-timer" % "0.1.0"
[com.infilos/relax-timer "0.1.0"]

Dependencies

compile (2)

Group / Artifact Type Version
com.google.code.findbugs : jsr305 jar 3.0.2
org.slf4j : slf4j-api jar 1.7.30

test (3)

Group / Artifact Type Version
junit : junit jar 4.12
org.awaitility : awaitility jar 3.1.6
ch.qos.logback : logback-classic jar 1.2.3

Project Modules

There are no modules declared in this project.

Relax Timer

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:

Usage

<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);

Release

  • Snapshot: mvn clean deploy
  • Release: mvn clean package source:jar gpg:sign install:install deploy:deploy

Versions

Version
0.1.0