Added extra memory reportings (heap, stack), stop tasks faster, added extra timeouts fro ServerKiller

This commit is contained in:
Shoghi Cervantes
2015-06-13 15:37:02 +02:00
parent 2ac27bd382
commit 33e312c7d0
9 changed files with 61 additions and 8 deletions

View File

@ -35,13 +35,16 @@ abstract class AsyncTask extends \Collectable{
private $result = null;
private $serialized = false;
private $cancelRun = false;
/** @var int */
private $taskId = null;
public function run(){
$this->result = null;
$this->onRun();
if($this->cancelRun !== true){
$this->onRun();
}
$this->setGarbage();
}
@ -62,6 +65,14 @@ abstract class AsyncTask extends \Collectable{
return $this->serialized ? unserialize($this->result) : $this->result;
}
public function cancelRun(){
$this->cancelRun = true;
}
public function hasCancelledRun(){
return $this->cancelRun === true;
}
/**
* @return bool
*/