Skip to content

Schedule routines to run after a certain time or whenever the the timer expires.

License

Notifications You must be signed in to change notification settings

wniemiec-task-java/scheduler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Scheduler

Schedule routines to run after a certain time or whenever the the timer expires.

Coverage status Java compatibility Maven Central release License


❇ Introduction

Scheduler allows you to perform operations with routines so that they are executed according to a criterion.

❓ How to use

  1. Add one of the options below to the pom.xml file:

Using Maven Central (recomended):

<dependency>
  <groupId>io.github.wniemiec-task-java</groupId>
  <artifactId>scheduler</artifactId>
  <version>LATEST</version>
</dependency>

Using GitHub Packages:

<dependency>
  <groupId>wniemiec.task.java</groupId>
  <artifactId>scheduler</artifactId>
  <version>LATEST</version>
</dependency>
  1. Run
$ mvn install
  1. Use it
[...]

import wniemiec.task.java.Scheduler;

[...]

Scheduler.setTimeout(() -> { System.out.println("Hello..."); }, 1000);
Scheduler.setTimeout(() -> { System.out.println("World!"); }, 1000);

📖 Documentation

Property Parameter type Return type Description Default parameter value
setTimeout routine: Routine, delay: long long Sets a timer which executes a routine once the timer expires -
setInterval routine: Routine, delay: long long Repeatedly calls a routine with a fixed time delay between each call -
clearInterval id: long void Cancels a timed, repeating action -
clearTimeout id: long void Cancels a timed action -
clearAllTimeout void void Clear all timeouts -
clearAllIntervals void void Clear all intervals -
setTimeoutToRoutine routine: Routine, delay: long boolean Runs a routine within a timeout. If the routine does not end on time, an interrupt signal will be sent to it -

🚩 Changelog

Details about each version are documented in the releases section.

🤝 Contribute!

See the documentation on how you can contribute to the project here.

📁 Files

/

Name Type Description
dist Directory Released versions
docs Directory Documentation files
src Directory Source files