mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-22 08:44:01 +00:00
Added a parameter to remove directly the async thread
This commit is contained in:
parent
79ca735fb0
commit
7c9eec7869
@ -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(){
|
||||
|
Loading…
x
Reference in New Issue
Block a user