Package net.md_5.bungee.api.scheduler
Interface TaskScheduler
- 
 public interface TaskSchedulerThis interface represents a scheduler which may be used to queue, delay and execute tasks in an asynchronous fashion.
- 
- 
Nested Class SummaryNested Classes Modifier and Type Interface Description static interfaceTaskScheduler.Unsafe
 - 
Method SummaryAll Methods Instance Methods Abstract Methods Modifier and Type Method Description voidcancel(int id)Cancel a task to prevent it from executing, or if its a repeating task, prevent its further execution.intcancel(Plugin plugin)Cancel all tasks owned by this plugin, this preventing them from being executed hereon in.voidcancel(ScheduledTask task)Cancel a task to prevent it from executing, or if its a repeating task, prevent its further execution.ScheduledTaskrunAsync(Plugin owner, Runnable task)Schedule a task to be executed asynchronously.ScheduledTaskschedule(Plugin owner, Runnable task, long delay, long period, TimeUnit unit)Schedules a task to be executed asynchronously after the specified delay is up.ScheduledTaskschedule(Plugin owner, Runnable task, long delay, TimeUnit unit)Schedules a task to be executed asynchronously after the specified delay is up.TaskScheduler.Unsafeunsafe()Get the unsafe methods of this class.
 
- 
- 
- 
Method Detail- 
cancelvoid cancel(int id) Cancel a task to prevent it from executing, or if its a repeating task, prevent its further execution.- Parameters:
- id- the id of the task to cancel
 
 - 
cancelvoid cancel(ScheduledTask task) Cancel a task to prevent it from executing, or if its a repeating task, prevent its further execution.- Parameters:
- task- the task to cancel
 
 - 
cancelint cancel(Plugin plugin) Cancel all tasks owned by this plugin, this preventing them from being executed hereon in.- Parameters:
- plugin- the plugin owning the tasks to be cancelled
- Returns:
- the number of tasks cancelled by this method
 
 - 
runAsyncScheduledTask runAsync(Plugin owner, Runnable task) Schedule a task to be executed asynchronously. The task will commence running as soon as this method returns.- Parameters:
- owner- the plugin owning this task
- task- the task to run
- Returns:
- the scheduled task
 
 - 
scheduleScheduledTask schedule(Plugin owner, Runnable task, long delay, TimeUnit unit) Schedules a task to be executed asynchronously after the specified delay is up.- Parameters:
- owner- the plugin owning this task
- task- the task to run
- delay- the delay before this task will be executed
- unit- the unit in which the delay will be measured
- Returns:
- the scheduled task
 
 - 
scheduleScheduledTask schedule(Plugin owner, Runnable task, long delay, long period, TimeUnit unit) Schedules a task to be executed asynchronously after the specified delay is up. The scheduled task will continue running at the specified interval. The interval will not begin to count down until the last task invocation is complete.- Parameters:
- owner- the plugin owning this task
- task- the task to run
- delay- the delay before this task will be executed
- period- the interval before subsequent executions of this task
- unit- the unit in which the delay and period will be measured
- Returns:
- the scheduled task
 
 - 
unsafeTaskScheduler.Unsafe unsafe() Get the unsafe methods of this class.- Returns:
- the unsafe method interface
 
 
- 
 
-