Reputation: 394
Is there a way I can be notified when a curl request completes? I'd like to start another request upon completion
$curl_handle=curl_init();
curl_setopt($curl_handle,CURLOPT_URL,'https://api.twitter.com/1/users/lookup.json?user_id='.$uids.'&include_entities=true');
curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($curl_handle);
curl_close($curl_handle);
Upvotes: 0
Views: 1655
Reputation: 665
cURL is "blocking" so when it's done you'll just move to the next line.
Simply call another URL after $result = curl_exec($curl_handle);
Upvotes: 2
Reputation: 47331
You don't have to execute curl in asynchronous manner,
use curl_multi_exec to parellel running multiple curl
(if network bandwidth is not a constraint)
Upvotes: 0