mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 17:59:48 +00:00
Added AsyncTask progress update API
This commit is contained in:
@ -142,8 +142,13 @@ class AsyncPool{
|
||||
Timings::$schedulerAsyncTimer->startTiming();
|
||||
|
||||
foreach($this->tasks as $task){
|
||||
if($task->progressUpdates !== null){
|
||||
if($task->progressUpdates->count() !== 0){
|
||||
$progress = $task->progressUpdates->shift();
|
||||
$task->onProgressUpdate($this->server, $progress);
|
||||
}
|
||||
}
|
||||
if($task->isGarbage() and !$task->isRunning() and !$task->isCrashed()){
|
||||
|
||||
if(!$task->hasCancelledRun()){
|
||||
$task->onCompletion($this->server);
|
||||
$this->server->getScheduler()->removeLocalComplex($task);
|
||||
|
Reference in New Issue
Block a user