endstone.scheduler
Classes:
| Name | Description |
|---|---|
Scheduler | Represents a scheduler that executes various tasks |
Task | Represents a task being executed by the scheduler |
Scheduler
Represents a scheduler that executes various tasks
Methods:
| Name | Description |
|---|---|
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 |
cancel_task
cancel_task(id:int) -> NoneRemoves task from scheduler.
cancel_tasks
cancel_tasks(plugin:Plugin) -> NoneRemoves 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) -> boolCheck if the task queued to be run later.
is_running
is_running(id:int) -> boolCheck if the task currently running.
run_task
run_task(
plugin: Plugin, task: Callable[[], None], delay: int = 0, period: int = 0
) -> TaskReturns a task that will be executed synchronously
Task
Represents a task being executed by the scheduler
Methods:
| Name | Description |
|---|---|
cancel | Attempts to cancel this task. |
Attributes:
| Name | Type | Description |
|---|---|---|
is_cancelled | bool | Returns true if the task has been cancelled. |
is_sync | bool | Returns true if the task is run by server thread. |
owner | Plugin | Returns the Plugin that owns the task. |
task_id | int | Returns the task id. |
is_cancelled
is_cancelled: boolReturns true if the task has been cancelled.
is_sync
is_sync: boolReturns true if the task is run by server thread.
owner
owner: PluginReturns the Plugin that owns the task.
task_id
task_id: intReturns the task id.
cancel
cancel() -> NoneAttempts to cancel this task.
Last updated on