|
@@ -303,35 +303,35 @@ abstract class ILooper
|
|
|
continue;
|
|
|
}
|
|
|
|
|
|
- go(function ()use ($content,$num,$mem)
|
|
|
- {
|
|
|
- foreach ($content as $key => $params) {
|
|
|
- DispatcherClient::instance()->push($key, $params);
|
|
|
- }
|
|
|
- $content = serialize($content);
|
|
|
- sleep(1);
|
|
|
- Log::record("content={$content}",Log::DEBUG);
|
|
|
- });
|
|
|
-
|
|
|
- continue;
|
|
|
-
|
|
|
-// if($this->_stop)
|
|
|
+// go(function ()use ($content,$num,$mem)
|
|
|
// {
|
|
|
// foreach ($content as $key => $params) {
|
|
|
// DispatcherClient::instance()->push($key, $params);
|
|
|
// }
|
|
|
-// }
|
|
|
-// else
|
|
|
-// {
|
|
|
-// go(function ()use ($content,$num,$mem) {
|
|
|
-// $start = microtime(true);
|
|
|
-// Log::record("BeginGoFunction coroutin_num={$num} memory={$mem}",Log::DEBUG);
|
|
|
-// $method = $this->handle($content);
|
|
|
-// $use_time = microtime(true) - $start;
|
|
|
-// $msg = sprintf("EndGoFunction coroutin_num={$num} memory={$mem} request_time=%.6f method={$method}",$use_time);
|
|
|
-// Log::record($msg,Log::DEBUG);
|
|
|
-// });
|
|
|
-// }
|
|
|
+// $content = serialize($content);
|
|
|
+// sleep(1);
|
|
|
+// Log::record("content={$content}",Log::DEBUG);
|
|
|
+// });
|
|
|
+//
|
|
|
+// continue;
|
|
|
+
|
|
|
+ if($this->_stop)
|
|
|
+ {
|
|
|
+ foreach ($content as $key => $params) {
|
|
|
+ DispatcherClient::instance()->push($key, $params);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ go(function ()use ($content,$num,$mem) {
|
|
|
+ $start = microtime(true);
|
|
|
+ Log::record("BeginGoFunction coroutin_num={$num} memory={$mem}",Log::DEBUG);
|
|
|
+ $method = $this->handle($content);
|
|
|
+ $use_time = microtime(true) - $start;
|
|
|
+ $msg = sprintf("EndGoFunction coroutin_num={$num} memory={$mem} request_time=%.6f method={$method}",$use_time);
|
|
|
+ Log::record($msg,Log::DEBUG);
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|
|
|
else {
|
|
|
Swoole\Coroutine::sleep(0.1);
|