Net::Curl::Promiser::AnyEvent - support for AnyEvent
my $promiser = Net::Curl::Promiser::AnyEvent->new(); my $handle = Net::Curl::Easy->new(); $handle->setopt( CURLOPT_URL() => $url ); my $cv = AnyEvent->condvar(); $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.
NOTE: The actual interface is that provided by Net::Curl::Promiser::LoopBase.
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.