I'm using PHP's curl_exec() to make a request to an API that has a very long running process. But I don't actually need to know the result, I only need the process to be started.
It doesn't matter to me if the process succeeds or fails. So I want to drop the connection as soon as I have made the request.
How can I drop the curl_exec connection? I don't want to wait 30 - 60 seconds for the response:
$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);
I believe that the solution will probably involve curl_multi?
You could use
CURLOPT_TIMEOUT
. From the manual: