这里详细描述问题
$options = [
'max_conn_per_addr' => 1000, // 每个域名最多维持多少并发连接
'keepalive_timeout' => 30, // 连接多长时间不通讯就关闭
'connect_timeout' => 30, // 连接超时时间
'timeout' => 30, // 请求发出后等待响应的超时时间
];
$http = new \Workerman\Http\ParallelClient( $options );
$http->push( $url, [ 'data' =>json_encode( $params ), 'headers' =>[ "Content-type: application/json" ] ] );
$result = $http ->await();
Please install revolt/event-loop to use parallel client. in /www/wwwroot/push/vendor/workerman/http-client/src/ParallelClient.php:31
将false改成true后
启动报错
Event loop terminated without resuming the current suspension (the cause is either a fiber deadlock, or an incorrectly unreferenced/canceled watcher): in /www/wwwroot/flowertown-push/vendor/revolt/event-loop/src/EventLoop/Internal/DriverSuspension.php:145
php8.3
webman v1.5.21
ParallelClient 是workerman v5的功能,v5还没发布
啊,那v4能实现类似的功能吗?就是异步发送一组http请求,然后完成后在发送下一组
可以,比如弄个计数,每次请求成功或失败计数减一,直到未0