Skip to Content
⚠ Under Construction
ReferencePython APIendstone.scheduler

endstone.scheduler

Classes:

NameDescription
SchedulerRepresents a scheduler that executes various tasks
TaskRepresents a task being executed by the scheduler

Scheduler

Represents a scheduler that executes various tasks

Methods:

NameDescription
cancel_taskRemoves task from scheduler.
cancel_tasksRemoves all tasks associated with a particular plugin from the scheduler.
get_pending_tasksReturns a vector of all pending tasks.
is_queuedCheck if the task queued to be run later.
is_runningCheck if the task currently running.
run_taskReturns a task that will be executed synchronously

cancel_task

cancel_task(id:int) -> None

Removes task from scheduler.

cancel_tasks

cancel_tasks(plugin:Plugin) -> None

Removes all tasks associated with a particular plugin from the scheduler.

get_pending_tasks

get_pending_tasks() -> list[Task]

Returns a vector of all pending tasks.

is_queued

is_queued(id:int) -> bool

Check if the task queued to be run later.

is_running

is_running(id:int) -> bool

Check if the task currently running.

run_task

run_task( plugin: Plugin, task: Callable[[], None], delay: int = 0, period: int = 0 ) -> Task

Returns a task that will be executed synchronously

Task

Represents a task being executed by the scheduler

Methods:

NameDescription
cancelAttempts to cancel this task.

Attributes:

NameTypeDescription
is_cancelledboolReturns true if the task has been cancelled.
is_syncboolReturns true if the task is run by server thread.
ownerPluginReturns the Plugin that owns the task.
task_idintReturns the task id.

is_cancelled

is_cancelled: bool

Returns true if the task has been cancelled.

is_sync

is_sync: bool

Returns true if the task is run by server thread.

owner

owner: Plugin

Returns the Plugin that owns the task.

task_id

task_id: int

Returns the task id.

cancel

cancel() -> None

Attempts to cancel this task.

Last updated on