curl => don't wait execution

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
ddragas
Forum Contributor
Posts: 445
Joined: Sun Apr 18, 2004 4:01 pm

curl => don't wait execution

Post by ddragas »

Hi all

is there a way to tell CULR not to wait execution of URL given, or is it possible to setup CURL curl_setopt($ch, CURLOPT_TIMEOUT, 0.00001);

thank you all

kind regards

ddragas
chakhar86
Forum Commoner
Posts: 45
Joined: Mon Jun 05, 2006 1:36 am
Contact:

Re: curl => don't wait execution

Post by chakhar86 »

can I suggest you multi-threading?
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Re: curl => don't wait execution

Post by onion2k »

chakhar86 wrote:can I suggest you multi-threading?
Now tell him how to write multi-threaded PHP code.

Hint: You can't.

You can use Multi Curl though - http://www.phpied.com/simultaneuos-http ... with-curl/ - it's not really the same as not waiting for the response though. If you just need to send a request to a page without waiting, or caring about, the response then an exec() call to wget might be a better option. Or alternatively you could use fsockopen() and set the socket to non-blocking. There's lots of ways of doing this sort of thing.
Post Reply