public interface TaskScheduler
| Modifier and Type | Interface and Description |
|---|---|
static interface |
TaskScheduler.Unsafe |
| Modifier and Type | Method and Description |
|---|---|
void |
cancel(int id)
Cancel a task to prevent it from executing, or if its a repeating task,
prevent its further execution.
|
int |
cancel(Plugin plugin)
Cancel all tasks owned by this plugin, this preventing them from being
executed hereon in.
|
void |
cancel(ScheduledTask task)
Cancel a task to prevent it from executing, or if its a repeating task,
prevent its further execution.
|
ScheduledTask |
runAsync(Plugin owner,
Runnable task)
Schedule a task to be executed asynchronously.
|
ScheduledTask |
schedule(Plugin owner,
Runnable task,
long delay,
long period,
TimeUnit unit)
Schedules a task to be executed asynchronously after the specified delay
is up.
|
ScheduledTask |
schedule(Plugin owner,
Runnable task,
long delay,
TimeUnit unit)
Schedules a task to be executed asynchronously after the specified delay
is up.
|
TaskScheduler.Unsafe |
unsafe()
Get the unsafe methods of this class.
|
void cancel(int id)
id - the id of the task to cancelvoid cancel(ScheduledTask task)
task - the task to cancelint cancel(Plugin plugin)
plugin - the plugin owning the tasks to be cancelledScheduledTask runAsync(Plugin owner, Runnable task)
owner - the plugin owning this tasktask - the task to runScheduledTask schedule(Plugin owner, Runnable task, long delay, TimeUnit unit)
owner - the plugin owning this tasktask - the task to rundelay - the delay before this task will be executedunit - the unit in which the delay will be measuredScheduledTask schedule(Plugin owner, Runnable task, long delay, long period, TimeUnit unit)
owner - the plugin owning this tasktask - the task to rundelay - the delay before this task will be executedperiod - the interval before subsequent executions of this taskunit - the unit in which the delay and period will be measuredTaskScheduler.Unsafe unsafe()
Copyright © 2012–2019 SpigotMC. All rights reserved.