J
John Bokma
Hi,
I am using LWP:
arallel::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?
I am using LWP:
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?