TaskManager is an easy to use zero dependency task manager / task queue.
FIFO, by design it queues tasks onto a single thread.
- Java Runtime 1.8 or higher
Add it as a maven dependency or just download the latest release.
<dependency>
<groupId>com.konloch</groupId>
<artifactId>TaskManager</artifactId>
<version>1.0.1</version>
</dependency>
For a more in-depth example of how to use the TaskManager, view this test file.
//create and start a new task manager
TaskManager manager = new TaskManager();
manager.start();
//run the code after a delay of 1 second
manager.delay(1000, (task)->{
System.out.println("This will execute after a delay of 1 second");
});
//create a task that will run forever
manager.doForever((task)->
{
//stop the task depending on some condition
if(someCondition)
task.stop();
else
System.out.println("This will execute until stopped");
});