Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

异步提示 Call to undefined function GuzzleHttp\Promise\settle() #8

Open
bilulanlv opened this issue Nov 13, 2023 · 1 comment
Open

Comments

@bilulanlv
Copy link

使用webman最新版加载了这个包,使用文档例子进行异步操作。出现错误,提示调用了没有定义的function。
$promise = Http::getAsync($url, function (Response $response) { echo '异步请求成功,响应内容:' . $response->body() . PHP_EOL; }, function (RequestException $e) { echo '异步请求异常,错误信息:' . $e->getMessage() . PHP_EOL; }); $promise->wait(); echo json_encode(['code' => 200, 'msg' => '请求成功'], JSON_UNESCAPED_UNICODE) . PHP_EOL;

GUZZLE版本
`guzzlehttp/guzzle 7.8.0 Guzzle is a PHP HTTP client library

guzzlehttp/promises 2.0.1 Guzzle promises library

guzzlehttp/psr7 2.6.1 PSR-7 message implementation that also provides common utility methods
`
下面是报错信息
Error: Call to undefined function GuzzleHttp\Promise\settle() in D:\Web\rsapi\vendor\yzh52521\easyhttp\src\Request.php:100
Stack trace:
#0 D:\Web\rsapi\vendor\guzzlehttp\promises\src\TaskQueue.php(50): yzh52521\EasyHttp\Request->__destruct()
#1 D:\Web\rsapi\vendor\guzzlehttp\guzzle\src\Handler\CurlMultiHandler.php(163): GuzzleHttp\Promise\TaskQueue->run()
#2 D:\Web\rsapi\vendor\guzzlehttp\guzzle\src\Handler\CurlMultiHandler.php(189): GuzzleHttp\Handler\CurlMultiHandler->tick()
#3 D:\Web\rsapi\vendor\guzzlehttp\promises\src\Promise.php(251): GuzzleHttp\Handler\CurlMultiHandler->execute(true)
#4 D:\Web\rsapi\vendor\guzzlehttp\promises\src\Promise.php(227): GuzzleHttp\Promise\Promise->invokeWaitFn()
#5 D:\Web\rsapi\vendor\guzzlehttp\promises\src\Promise.php(272): GuzzleHttp\Promise\Promise->waitIfPending()
#6 D:\Web\rsapi\vendor\guzzlehttp\promises\src\Promise.php(229): GuzzleHttp\Promise\Promise->invokeWaitList()
#7 D:\Web\rsapi\vendor\guzzlehttp\promises\src\Promise.php(69): GuzzleHttp\Promise\Promise->waitIfPending()
#8 D:\Web\rsapi\app\controller\TestController.php(34): GuzzleHttp\Promise\Promise->wait()
#9 D:\Web\rsapi\vendor\workerman\webman-framework\src\App.php(325): app\controller\TestController->index(Object(support\Request))
#10 D:\Web\rsapi\vendor\workerman\webman-framework\src\App.php(168): Webman\App::Webman{closure}(Object(support\Request))
#11 D:\Web\rsapi\vendor\workerman\workerman\Connection\TcpConnection.php(646): Webman\App->onMessage(Object(Workerman\Connection\TcpConnection), Object(support\Request))
#12 D:\Web\rsapi\vendor\workerman\workerman\Events\Select.php(311): Workerman\Connection\TcpConnection->baseRead(Resource id #366)
#13 D:\Web\rsapi\vendor\workerman\workerman\Worker.php(1485): Workerman\Events\Select->loop()
#14 D:\Web\rsapi\vendor\workerman\workerman\Worker.php(1402): Workerman\Worker::forkWorkersForWindows()
#15 D:\Web\rsapi\vendor\workerman\workerman\Worker.php(560): Workerman\Worker::forkWorkers()
#16 D:\Web\rsapi\vendor\workerman\webman-framework\src\support\App.php(131): Workerman\Worker::runAll()
#17 D:\Web\rsapi\start.php(4): support\App::run()
#18 {main} [] []

@yuanzhihai
Copy link
Owner

已修复 升级最新版

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants