Annotation Interface TaskHandler
Marks a method as a task handler, meaning it will be registered and called as a scheduled task in the
The method can have one
PluginScheduler.
The method can have one
Cancellable parameter to allow the task to cancel itself.-
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionbooleanWhether the task should be executed asynchronously.longThe initial delay before the first execution of the task.longThe interval between each execution of the task.The time unit of the interval and initial delay.
-
Element Details
-
interval
long intervalThe interval between each execution of the task. The task will be executed once if the interval is set to a value below -1.- Default:
- -1L
-
delay
long delayThe initial delay before the first execution of the task. The task will be executed immediately if the delay is set to a value below -1.- Default:
- -1L
-
unit
MindustryTimeUnit unitThe time unit of the interval and initial delay.- Default:
- SECONDS
-
async
boolean asyncWhether the task should be executed asynchronously.- Default:
- false
-