mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-23 13:09:44 +00:00
Added a parameter to remove directly the async thread
This commit is contained in:
parent
79ca735fb0
commit
7c9eec7869
1 changed files with 3 additions and 3 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue