|
@@ -237,11 +237,20 @@ abstract class ILooper
|
|
$content = $this->mServer->pop($queues,1);
|
|
$content = $this->mServer->pop($queues,1);
|
|
if(empty($content)) continue;
|
|
if(empty($content)) continue;
|
|
|
|
|
|
- go(function ()use ($content) {
|
|
|
|
- Log::record("BegigGoFunction",Log::DEBUG);
|
|
|
|
- $this->handle($content);
|
|
|
|
- Log::record("EndGoFunction",Log::DEBUG);
|
|
|
|
- });
|
|
|
|
|
|
+ if($this->_stop)
|
|
|
|
+ {
|
|
|
|
+ foreach ($content as $key => $params) {
|
|
|
|
+ DispatcherClient::instance()->push($key, $params);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ go(function ()use ($content) {
|
|
|
|
+ Log::record("BegigGoFunction",Log::DEBUG);
|
|
|
|
+ $this->handle($content);
|
|
|
|
+ Log::record("EndGoFunction",Log::DEBUG);
|
|
|
|
+ });
|
|
|
|
+ }
|
|
}
|
|
}
|
|
else {
|
|
else {
|
|
\Swoole\Coroutine::sleep(0.1);
|
|
\Swoole\Coroutine::sleep(0.1);
|
|
@@ -257,13 +266,22 @@ abstract class ILooper
|
|
$content = $this->mServer->pop($queues,1);
|
|
$content = $this->mServer->pop($queues,1);
|
|
if(empty($content)) continue;
|
|
if(empty($content)) continue;
|
|
|
|
|
|
- perfor_clear();
|
|
|
|
- perfor_start();
|
|
|
|
- $this->handle($content);
|
|
|
|
- perfor_end('Handle Request');
|
|
|
|
- $info = perfor_log();
|
|
|
|
|
|
+ if($this->_stop)
|
|
|
|
+ {
|
|
|
|
+ foreach ($content as $key => $params) {
|
|
|
|
+ DispatcherClient::instance()->push($key, $params);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ perfor_clear();
|
|
|
|
+ perfor_start();
|
|
|
|
+ $this->handle($content);
|
|
|
|
+ perfor_end('Handle Request');
|
|
|
|
+ $info = perfor_log();
|
|
|
|
+ Log::record("{$info} \r\n",Log::DEBUG);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
- Log::record("{$info} \r\n",Log::DEBUG);
|
|
|
|
}
|
|
}
|
|
catch (Exception $e)
|
|
catch (Exception $e)
|
|
{
|
|
{
|