Scheduler: shutdown async pool properly instead of relying on ThreadManager

This commit is contained in:
Dylan K. Taylor
2018-05-09 19:49:12 +01:00
parent 05f4262e81
commit c9bd60123b
3 changed files with 16 additions and 3 deletions

View File

@ -183,4 +183,13 @@ class AsyncPool{
Timings::$schedulerAsyncTimer->stopTiming();
}
public function shutdown() : void{
$this->collectTasks();
$this->removeTasks();
foreach($this->workers as $worker){
$worker->quit();
}
$this->workers = [];
}
}