From 7c9eec7869cb0c0b54babebb4127204690780084 Mon Sep 17 00:00:00 2001 From: Shoghi Cervantes Pueyo Date: Tue, 9 Apr 2013 17:23:29 +0200 Subject: [PATCH] Added a parameter to remove directly the async thread --- src/API/ServerAPI.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/API/ServerAPI.php b/src/API/ServerAPI.php index 45a08c3e..0b3f14c0 100644 --- a/src/API/ServerAPI.php +++ b/src/API/ServerAPI.php @@ -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(){