[This is preliminary documentation and is subject to change.]
The SchedulerTask type exposes the following properties.
Properties
| Member | Description | |
|---|---|---|
| AdjustForExecutionTime | Whether to adjust Interval for execution time (for recurring tasks).
If enabled, the Interval timer is started as soon as execution starts.
Total delay between executions is then equal to Interval.
If disabled, the Interval timer is started only after execution finishes.
Total delay between executions is then (time to execute + Interval). | |
| Callback | Method to call to execute the task. | |
| Delay | Initial execution delay. | |
| Interval | Interval between executions (for recurring tasks). | |
| IsBackground | Whether the task should be ran in the background. | |
| IsCritical | Whether this task should be allowed to finish after server shutdown. | |
| IsExecuting | Whether the task is currently being executed. | |
| IsRecurring | Whether the task is one-use or recurring. | |
| IsStopped | Whether the task has stopped.
RunOnce tasks stop after first execution.
RunForever and RunManual tasks only stop manually.
RunRepeating stops after max number of repeats is reached. | |
| MaxRepeats | Maximum number of repeats for RunRepeating tasks.
Set to -1 to run forever. | |
| NextTime | Next scheduled execution time (UTC). | |
| UserState | General-purpose persistent state object,
can be used for anything you want. |