Net::Curl::Promiser::AnyEvent
my $promiser = Net::Curl::Promiser::AnyEvent->new(); my $cv = AnyEvent->condvar(); my $handle = Net::Curl::Easy->new(); $handle->setopt( CURLOPT_URL() => $url ); $promiser->add_handle($handle)->then( sub { print "$url completed.$/" }, sub { warn "$url failed: " . shift }, )->finally($cv); $cv->recv();
This module provides an AnyEvent-compatible interface for Net::Curl::Promiser.
See /examples in the distribution for a fleshed-out demonstration.
The following methods from Net::Curl::Promiser are unneeded in this class and thus produce an exception if called:
process()
time_out()
get_timeout()
To install Net::Curl::Promiser, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Net::Curl::Promiser
CPAN shell
perl -MCPAN -e shell install Net::Curl::Promiser
For more information on module installation, please visit the detailed CPAN module installation guide.