Net::Curl::Promiser::IOAsync - support for IO::Async
my $loop = IO::Async::Loop->new(); my $promiser = Net::Curl::Promiser::IOAsync->new($loop); 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( sub { $loop->stop() } ); $loop->run();
This module provides an IO::Async-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.