endstone.scheduler

Classes relating to letting plugins run code at specific time intervals.

Classes relating to letting plugins run code at specific time intervals.

Classes

NameDescription
Scheduler

Represents a scheduler that executes various tasks

Task

Represents a task being executed by the scheduler

classScheduler

Scheduler()

Represents a scheduler that executes various tasks

Methods

NameDescription
cancel_task

Removes task from scheduler.

cancel_tasks

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

get_pending_tasks

Returns a vector of all pending tasks.

is_queued

Check if the task queued to be run later.

is_running

Check if the task currently running.

run_task

Returns a task that will be executed synchronously

methcancel_task

cancel_task(id: int) -> None

Removes task from scheduler.

methcancel_tasks

cancel_tasks(plugin: Plugin) -> None

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

methget_pending_tasks

get_pending_tasks() -> list[Task]

Returns a vector of all pending tasks.

methis_queued

is_queued(id: int) -> bool

Check if the task queued to be run later.

methis_running

is_running(id: int) -> bool

Check if the task currently running.

methrun_task

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

Returns a task that will be executed synchronously

classTask

Task()

Represents a task being executed by the scheduler

Methods

NameDescription
cancel

Attempts to cancel this task.

Attributes

NameTypeDescription
is_cancelledbool

Returns true if the task has been cancelled.

is_syncbool

Returns true if the task is run by server thread.

ownerPlugin

Returns the Plugin that owns the task.

task_idint

Returns the task id.

attris_cancelledproperty

is_cancelled: bool

Returns true if the task has been cancelled.

attris_syncproperty

is_sync: bool

Returns true if the task is run by server thread.

attrownerproperty

owner: Plugin

Returns the Plugin that owns the task.

attrtask_idproperty

task_id: int

Returns the task id.

methcancel

cancel() -> None

Attempts to cancel this task.

On this page