WWW::Chain - A web request chain
version 0.001
my $chain = WWW::Chain->new(HTTP::Request->new( GET => 'http://localhost/' ), sub { my ( $chain, $response ) = @_; $chain->stash->{first_request} = 'done'; return HTTP::Request->new( GET => 'http://localhost/' ), HTTP::Request->new( GET => 'http://other.localhost/' ), sub { my ( $chain, $first_response, $second_response ) = @_; $chain->stash->{two_calls_finished} = 'done'; return; }; }); # Blocking usage my $ua = WWW::Chain::UA::LWP->new; $ua->request_chain($chain); # ... or non blocking usage example unless ($chain->done) { my @http_requests = @{$chain->next_requests}; # ... execute the HTTP::Request objects to get HTTP::Response objects $chain->next_responses(@http_responses); } # Working with the result print $chain->stash->{two_calls_finished};
Torsten Raudssus <torsten@raudss.us>
This software is copyright (c) 2012 by Torsten Raudssus.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install WWW::Chain, copy and paste the appropriate command in to your terminal.
cpanm
cpanm WWW::Chain
CPAN shell
perl -MCPAN -e shell install WWW::Chain
For more information on module installation, please visit the detailed CPAN module installation guide.