Worked on scheduler

This commit is contained in:
Shoghi Cervantes
2014-10-11 16:36:38 +02:00
parent 341717c89d
commit 7f85e37540
4 changed files with 18 additions and 35 deletions

View File

@ -26,24 +26,20 @@ use pocketmine\Server;
/**
* Class used to run async tasks in other threads.
*
* WARNING: Do not call PocketMine-MP API methods from other Threads!!
* WARNING: Do not call PocketMine-MP API methods, or save objects from/on other Threads!!
*/
abstract class AsyncTask extends \Threaded{
abstract class AsyncTask extends \Collectable{
protected $complete = null;
protected $finished = null;
protected $result = null;
protected $taskId = null;
private $finished = null;
private $result = null;
private $taskId = null;
public function run(){
$this->finished = false;
$this->complete = false;
$this->result = null;
$this->onRun();
$this->finished = true;
}
/**
@ -53,17 +49,6 @@ abstract class AsyncTask extends \Threaded{
return $this->finished === true;
}
/**
* @return bool
*/
public function isCompleted(){
return $this->complete === true;
}
public function setCompleted(){
$this->complete = true;
}
/**
* @return mixed
*/