Added a parameter to remove directly the async thread

This commit is contained in:
Shoghi Cervantes Pueyo 2013-04-09 17:23:29 +02:00
parent 79ca735fb0
commit 7c9eec7869

View File

@ -229,10 +229,10 @@ class ServerAPI{
$this->server->loadEntities();
}
public function async(callable $callable, $params = array()){
public function async(callable $callable, $params = array(), $remove = false){
$cnt = $this->asyncCnt++;
$this->asyncCalls[$cnt] = new Async($callable, $params);
return $cnt;
return $remove === true ? $this->getAsync($cnt):$cnt;
}
public function getAsync($id){
@ -263,7 +263,7 @@ class ServerAPI{
"plugins" => $plist,
),
2 => 10
));
), true);
}
public function __destruct(){