mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-22 19:34:02 +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();
|
$this->server->loadEntities();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function async(callable $callable, $params = array()){
|
public function async(callable $callable, $params = array(), $remove = false){
|
||||||
$cnt = $this->asyncCnt++;
|
$cnt = $this->asyncCnt++;
|
||||||
$this->asyncCalls[$cnt] = new Async($callable, $params);
|
$this->asyncCalls[$cnt] = new Async($callable, $params);
|
||||||
return $cnt;
|
return $remove === true ? $this->getAsync($cnt):$cnt;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getAsync($id){
|
public function getAsync($id){
|
||||||
@ -263,7 +263,7 @@ class ServerAPI{
|
|||||||
"plugins" => $plist,
|
"plugins" => $plist,
|
||||||
),
|
),
|
||||||
2 => 10
|
2 => 10
|
||||||
));
|
), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function __destruct(){
|
public function __destruct(){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user