◆ __construct()
◆ cancelAllTasks()
167 foreach($this->tasks as $task){
171 $this->asyncPool->removeTasks();
172 while(!$this->queue->isEmpty()){
173 $this->queue->extract();
◆ cancelTask()
- Parameters
-
147 if($taskId !== null and isset($this->tasks[$taskId])){
148 $this->tasks[$taskId]->cancel();
149 unset($this->tasks[$taskId]);
◆ cancelTasks()
- Parameters
-
157 foreach($this->tasks as $taskId => $task){
158 $ptask = $task->getTask();
159 if($ptask instanceof PluginTask and $ptask->getOwner() === $plugin){
161 unset($this->tasks[$taskId]);
◆ getAsyncTaskPoolSize()
- Returns
- int
102 return $this->asyncPool->getSize();
◆ increaseAsyncTaskPoolSize()
increaseAsyncTaskPoolSize |
( |
|
$newSize | ) |
|
- Parameters
-
109 $this->asyncPool->increaseSize($newSize);
◆ isQueued()
- Parameters
-
- Returns
- bool
184 return isset($this->tasks[$taskId]);
◆ scheduleAsyncTask()
Submits an asynchronous task to the Worker Pool
- Parameters
-
- Returns
- void
79 $id = $this->nextId();
80 $task->setTaskId($id);
81 $this->asyncPool->submitTask($task);
◆ scheduleAsyncTaskToWorker()
scheduleAsyncTaskToWorker |
( |
AsyncTask |
$task, |
|
|
|
$worker |
|
) |
| |
Submits an asynchronous task to a specific Worker in the Pool
- Parameters
-
- Returns
- void
93 $id = $this->nextId();
94 $task->setTaskId($id);
95 $this->asyncPool->submitTaskToWorker($task, $worker);
◆ scheduleDelayedRepeatingTask()
scheduleDelayedRepeatingTask |
( |
Task |
$task, |
|
|
|
$delay, |
|
|
|
$period |
|
) |
| |
- Parameters
-
Task | $task | |
int | $delay | |
int | $period | |
- Returns
- null|TaskHandler
140 return $this->addTask($task, (
int) $delay, (
int) $period);
◆ scheduleDelayedTask()
scheduleDelayedTask |
( |
Task |
$task, |
|
|
|
$delay |
|
) |
| |
- Parameters
-
- Returns
- null|TaskHandler
119 return $this->addTask($task, (
int) $delay, -1);
◆ scheduleRepeatingTask()
scheduleRepeatingTask |
( |
Task |
$task, |
|
|
|
$period |
|
) |
| |
- Parameters
-
- Returns
- null|TaskHandler
129 return $this->addTask($task, -1, (
int) $period);
◆ scheduleTask()
scheduleTask |
( |
Task |
$task | ) |
|
- Parameters
-
- Returns
- null|TaskHandler
68 return $this->addTask($task, -1, -1);
◆ $asyncPool
◆ $currentTick
◆ $queue
◆ $tasks
◆ $WORKERS
The documentation for this class was generated from the following file:
- src/pocketmine/scheduler/ServerScheduler.php