Scheduler

@ThreadSafe
interface Scheduler

A scheduler that will execute tasks with a precision dependent on the tick rate of the server.

This does not necessarily mean that task execution times are dependent on the server's tick rate, only that the scheduler will attempt to execute tasks at the same rate as the server's tick rate.

Functions

Link copied to clipboard
abstract fun buildTask(task: Runnable): Task.Builder

Creates a new task builder that will execute the given task.

Link copied to clipboard
open fun scheduleTask(task: Runnable, delay: TaskTime, period: TaskTime): Task

Schedules the given task to be executed by the scheduler after the given delay, with a period between executions of period.

open fun scheduleTask(task: Runnable, delay: TaskTime, period: TaskTime, executionType: ExecutionType): Task

Schedules the given task to be executed by the scheduler after the given delay, with a period between executions of period, and with the given executionType.

Link copied to clipboard
abstract fun submitTask(task: Supplier<TaskAction>): Task
abstract fun submitTask(task: Supplier<TaskAction>, executionType: ExecutionType): Task

Submits a task to be executed by the scheduler.