【发布时间】:2016-04-15 07:54:51
【问题描述】:
我正在使用通过 composer 安装的Guzzle,但没有做一些相对简单的事情。
我可能误解了documentation,但基本上我想要做的是向服务器运行POST 请求并继续执行代码而不等待响应。这是我所拥有的:
$client = new \GuzzleHttp\Client(/*baseUrl, and auth credentials here*/);
$client->post('runtime/process-instances', [
'future'=>true,
'json'=> $data // is an array
]);
die("I'm done with the call");
现在假设runtime/process-instances 运行了大约 500 万,在这 500 万用完之前我不会收到 die 消息...相反,我希望在消息 发送 到服务器。
现在我无法访问服务器,因此在运行执行之前我无法让服务器响应。我只需要忽略响应即可。
感谢任何帮助。
我尝试过的事情:
$client->post(/*blabla*/)->then(function ($response) {});
【问题讨论】: