LWP::Parallel how to process results

J

John Bokma

Hi,

I am using LWP::parallel::UserAgent

I register requests, and $pua->wait() returns a hash ref, the keys are the
stringified registered requests (HTTP::Requests).

Since I want each result to have it's own handler, I currently make a look
up table (hash) with stringified request object ref as key and a ref to a
sub as value, and do something like:

for my $key ( keys %$entries ) {

my $response = $entries->{$key}->response;

my $callback = $key2callback{ $key };
$callback->( $response->content );
}

Is there a more clean approach?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top