Forum Moderators: coopster

Message Too Old, No Replies

PHP Parallel Requests

I want to make http requests at the same time as in LWP Parallel for PERL

         

JerryOdom

8:45 pm on Oct 6, 2004 (gmt 0)

10+ Year Member



Does anyone know if this can be done? In perl its simple via LWP Parallel but I've yet to figure a way in ony PHP.

Thanks! -Jerry

Adrian2k4

1:46 am on Oct 7, 2004 (gmt 0)

10+ Year Member



what do you exactly meen with parallel requests?

mincklerstraat

9:01 am on Oct 7, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Won't open one connection, read that file to a variable, close the connection, open another connection ... (serial) but be able to get a bunch of files over http simultaneously - can save time.

I don't know, I think looking at the curl functions might be your best bet. [be2.php.net...] .

lazydog

12:22 pm on Oct 7, 2004 (gmt 0)

10+ Year Member



This previous thread might help you -
[webmasterworld.com...]

JerryOdom

7:57 pm on Oct 8, 2004 (gmt 0)

10+ Year Member



When I say parallel I mean being able to retrieve 5 different http resources at the same time. So that if they each take at most 2 seconds to come back to me then the entire retrieval process takes 2 seconds and not 10.

At a glance curl looks like it may do what I want. Thank you and I'll post here to let you all know.

sabai

6:06 pm on Oct 9, 2004 (gmt 0)

10+ Year Member



You're talking about multi threading, which is shaky ground as far as php goes... multi-thread perl is fairly mature on the other hand. Look into pcntl_fork and do some web searching for multithreaded php. You'll need apache 2 compiled for multi-threading I think.

If you're using a web host then forget about it.

Good luck!

sabai

6:09 pm on Oct 9, 2004 (gmt 0)

10+ Year Member



Hey, I take it all back... looks like php5 does it with curl_multi_exec.