public class AsyncScheduler extends Object
Modifier and Type | Method and Description |
---|---|
protected void |
addTask(ScheduledTask task)
Adds the task to the task map, will attempt to process the task on the
next call to
runTick() . |
protected void |
executeTaskRunnable(Runnable runnable)
Actually run the runnable that will begin the task
|
protected void |
finallyPostTick()
Fired after tasks have attempted to be processed, in a finally block to
guarantee execution regardless of any error when processing a task.
|
protected Set<org.spongepowered.api.service.scheduler.Task> |
getScheduledTasks() |
protected Optional<org.spongepowered.api.service.scheduler.Task> |
getTask(UUID id) |
protected long |
getTimestamp(ScheduledTask task)
Gets the timestamp to update the timestamp of a task.
|
protected String |
nextName(org.spongepowered.api.plugin.PluginContainer plugin) |
protected void |
postTick()
Fired when the scheduler has processed all tasks.
|
protected void |
preTick()
Fired when the scheduler begins to tick, before any tasks are processed.
|
protected void |
processTask(ScheduledTask task)
Processes the task.
|
protected void |
removeTask(ScheduledTask task)
Removes the task from the task map.
|
protected void |
runTick()
Process all tasks in the map.
|
protected void |
startTask(ScheduledTask task)
Begin the execution of a task.
|
protected void preTick()
protected void postTick()
protected void finallyPostTick()
protected void executeTaskRunnable(Runnable runnable)
runnable
- The runnable to runprotected void addTask(ScheduledTask task)
runTick()
.task
- The task to addprotected String nextName(org.spongepowered.api.plugin.PluginContainer plugin)
protected long getTimestamp(ScheduledTask task)
task
- The taskprotected void removeTask(ScheduledTask task)
task
- The task to removeprotected Set<org.spongepowered.api.service.scheduler.Task> getScheduledTasks()
protected final void runTick()
protected void processTask(ScheduledTask task)
task
- The task to processprotected void startTask(ScheduledTask task)
task
- The task to start