stanley-king 3 years ago
parent
commit
66c919e514
1 changed files with 25 additions and 25 deletions
  1. 25 25
      helper/queue/iqueue.php

+ 25 - 25
helper/queue/iqueue.php

@@ -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);