SWOOLE_HOOK_NATIVE_CURL|SWOOLE_HOOK_SLEEP]); class RefillSender { public function send() { $time = time(); for ($i = 0; $i < 10000; $i++) { $pThis = $this; go(function () use($time, $i,$pThis) { $pThis->push_order(1092, $time, $i); }); } } private function push_order($mchid,$time,$index) { $notify_url = "https://test.xyzshops.cn/mobile/callback/bridge_test.php"; $params = [ 'mchid' => $mchid, 'amount' => 30, 'order_sn' => "{$time}" . sprintf("%'010d",$index), 'cardno' => '13911129867', "act" => "refill", "op" => "add", 'notifyurl' => $notify_url ]; $proxy = new refill_proxy("210fe406954220f56085997d6a4c5b80"); $resp = $proxy->send("https://test.xyzshops.cn/mobile/index.php", $params); $resp = json_encode($resp); Log::record("resp={$resp}",Log::DEBUG); } } Log::record("send message start",Log::DEBUG); go(function () { $sender = new RefillSender(); $sender->send(); }); Log::record("send message end",Log::DEBUG);