in reply to Re: Re: Using LWP::Parallel
in thread Using LWP::Parallel

I wouldn't call it trivial if people have no experience with POE. I for one didn't understand from your example how you were suggesting it would help him towards his goal of retrieving no more then 10 at a time.

After reading the POE, POE::Session, & POE::Component::Client::UserAgent I *think* what you're suggesting is that the poster modifying 02multi.t so that this...

POE::Session -> create ( inline_states => { _start => \&_start, _stop => \&_stop, response => \&response, _signal => \&_signal }, );
becomes this...
for (my $i = 0; $i < 10; $i++) { POE::Session -> create ( inline_states => { _start => \&_start, _stop => \&_stop, response => \&response, _signal => \&_signal }, ); }
and change _start to only loop over a 1/10 of @urls.

Does that sound about right?

Frankly, i'm still not clear on why this can't be done in a more straight forward manner with LWP::Parallel directly, It has the functionality to limit the number of parrallel requests to an individual server -- OR to limit the number of different servers it sends requests to at the same time, ... why isn't there a more general way to limit the TOTAL number of parrallel requests?

Replies are listed 'Best First'.
Re: Re: Re: Re: Using LWP::Parallel
by mugwumpjism (Hermit) on Mar 12, 2002 at 20:13 UTC
    Frankly, i'm still not clear on why this can't be done in a more straight forward manner with LWP::Parallel directly, ...

    Well, for a start you can't do anything while the fetch is happening.

    I've written a little script that keeps 10 threads; it's in my original post. As you can see, there's not much to it.

    (Event-based programming)++