1234567891011121314151617181920212223242526272829303132333435363738394041 |
- <?php
- declare(strict_types=0);
- define('APP_ID', 'rdispatcher');
- define('MOBILE_SERVER',true);
- define('BASE_ROOT_PATH',str_replace('/rdispatcher','',dirname(__FILE__)));
- define('BASE_PATH',BASE_ROOT_PATH . '/rdispatcher');
- require_once(BASE_ROOT_PATH . '/global.php');
- require_once(BASE_ROOT_PATH . '/fooder.php');
- //require_once(BASE_ROOT_PATH . '/helper/event_looper.php');
- //require_once(BASE_HELPER_PATH . '/queue/rdispatcher.php');
- //require_once(BASE_HELPER_PATH . '/refill/RefillFactory.php');
- require_once(BASE_PATH . '/processor.php');
- //require_once(BASE_PATH . '/proxy.php');
- //require_once(BASE_PATH . '/yzpolicy.php');
- require_once(BASE_ROOT_PATH . '/core/framework/function/http.php');
- Co::set(['hook_flags' => SWOOLE_HOOK_ALL]);
- Co\run(function()
- {
- $n = 1000;
- $i = 0;
- Log::record("start {$i}", Log::DEBUG);
- while ($n--) {
- go(function () use ($i) {
- Log::record("start {$i}", Log::DEBUG);
- $resp = http_request('https://www.xyzshops.cn/mobile/index.php?act=index&op=index&client_type=ios');
- Log::record("recv {$i} size=" . strlen($resp), Log::DEBUG);
- $resp = http_request('https://www.xyzshops.cn/mobile/index.php?act=index&op=index&client_type=ios');
- Log::record("recv {$i} size=" . strlen($resp), Log::DEBUG);
- $resp = http_request('https://www.xyzshops.cn/mobile/index.php?act=index&op=index&client_type=ios');
- Log::record("recv {$i} size=" . strlen($resp), Log::DEBUG);
- });
- $i++;
- Co::sleep(0.0001);
- }
- });
|