我正在使用 PHP 的 curl_exec() 向一个运行时间很长的 API 发出请求。但我实际上并不需要知道结果,我只需要启动过程。
这个过程是成功还是失败对我来说并不重要。所以我想在我提出请求后立即断开连接。
如何删除 curl_exec 连接?我不想等待 30 - 60 秒的响应:
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://example.com/LongRunningProcess/parameter");
curl_exec($ch);
// need to do something here to just drop the connection, don't wait for curl_exec
// but what is that something?
curl_close($ch);
我相信解决方案可能会涉及 curl_multi?