mMchid = 1; } else { $this->mMchid = 1092; } } public function testPushMessage() { foreach (range(1,2000,1) as $i) { queue\DispatcherClient::instance()->push('xxx',$i); } } public function testAdd() { foreach (range(1,2000,1) as $i) { queue\DispatcherClient::instance()->push('add',[]); } } public function testAddoil() { foreach (range(1,1,1) as $i) { queue\DispatcherClient::instance()->push('add',$this->make_order()); } } private function make_order() { $mchid = $this->mMchid; $mchinfo = Model('merchant')->getMerchantInfo(['mchid' => $mchid]); $buyer_id = intval($mchinfo['admin_id']); $params = [ 'mchid' => $this->mMchid, 'buyer_id' => $buyer_id, 'amount' => 50, 'card_no' => 13911129867, 'mch_order' => $this->make_sn(), 'notify_url' => 'https://www.xyzshops.cn/mobile/signature.php']; return $params; } private function make_sn() { return mt_rand(1000, 9999) . sprintf('%010d', time()) . sprintf('%06d', (float)microtime() * 1000000); } public function testCurl() { Swoole\Coroutine\run(function () { $curl = curl_init(); var_dump($curl, (int) $curl); //resource(4) of type (Swoole-Coroutine-cURL Handle) //int(4) $resp = http_request('https://www.xyzshops.cn/mobile/index.php?act=index&op=index&client_type=ios'); Log::record("recv size=" . strlen($resp), Log::DEBUG); }); } public function testDefine() { $x = MASTER_DBHOST . 'xxx'; } }