Added AsyncTask::onCompletion()

This commit is contained in:
Shoghi Cervantes
2014-06-25 13:01:39 +02:00
parent f9d9d2b0e5
commit 80aebf2932
4 changed files with 19 additions and 8 deletions

View File

@ -25,6 +25,7 @@
namespace pocketmine\scheduler;
use pocketmine\plugin\Plugin;
use pocketmine\Server;
use pocketmine\utils\ReversePriorityQueue;
class ServerScheduler{
@ -216,7 +217,7 @@ class ServerScheduler{
$this->asyncPool->collect(function (AsyncTask $task){
if($task->isCompleted() or ($task->isFinished() and !$task->hasResult())){
--$this->asyncTasks;
$task->onCompletion(Server::getInstance());
return true;
}