-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
**Scheduler** | ||
= | ||
Created by Justin | ||
|
||
Description | ||
- | ||
Scheduler is a library which adds the @Scheduled and @Delayed annotations. The @Scheduled annotation makes the method it | ||
is attatched to run at a set interval while the @Delayed annotation delays calls to its method. | ||
|
||
SchedulerController#delay() may be called instead of using the @Delayed annotation | ||
|
||
Scheduler can and should be shaded into your jar. | ||
|
||
SchedulerController#initialize() must be called. | ||
|
||
#### @Scheduled | ||
|
||
The Scheduled annotation takes in a double for each time unit, and a boolean for whether to schedule the target method | ||
out of sync or not. The interval that the method is scheduled at is equal to the sum of all times entered. In order to | ||
have the annotation take effect you must call SchedulerController#registerSynchronizationService() for the object | ||
holding the annotated method. | ||
|
||
You may call SchedulerController#dismissSynchronizationService() to stop all scheduled tasks for a source | ||
|
||
#### @Delayed | ||
|
||
The Scheduled annotation takes in a double for each time unit, and a boolean for whether to schedule the target method | ||
out of sync or not. The delay takes place before the method is actually called is equal to the sum of all times entered. | ||
In order to have the annotation take effect you must call SchedulerController#processAnnotationsFor(className) or | ||
processAnnotationsIn(packageName) before the classes holding the annotations are loaded. | ||
|
||
This annotation changes the bytecode of classes by basically wrapping methods annotated with @Delayed with | ||
a call to SchedulerController#delay(). |