public function cancelAllTasks() { foreach ($this->tasks as $task) { $task->cancel(); } $this->tasks = []; $this->asyncPool->removeTasks(); $this->queue = new ReversePriorityQueue(); $this->ids = 1; }
public function cancelAllTasks() { foreach ($this->tasks as $task) { $task->cancel(); } $this->tasks = []; $this->asyncPool->removeTasks(); while (!$this->queue->isEmpty()) { $this->queue->extract(); } $this->ids = 1; }