Promiser/AnyEvent.pm untested

filter: Statementstmt 0.0% 0 / 14 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 5 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 20 CC 1 SCAR 6.9
CC
1
Cov
0%
_INIT
2.0
BEGIN
2.0
BEGIN
2.0
CRAP 2.0
1 package Net::Curl::Promiser::AnyEvent;
2  
3 use strict;
4 use warnings;
5  
6 =encoding utf-8
7  
8 =head1 NAME
9  
10 Net::Curl::Promiser::AnyEvent - support for L<AnyEvent>
11  
12 =head1 SYNOPSIS
13  
14 my $promiser = Net::Curl::Promiser::AnyEvent->new();
15  
16 my $handle = Net::Curl::Easy->new();
17 $handle->setopt( CURLOPT_URL() => $url );
18  
19 my $cv = AnyEvent->condvar();
20  
21 $promiser->add_handle($handle)->then(
22 sub { print "$url completed.$/" },
23 sub { warn "$url failed: " . shift },
24 )->finally($cv);
25  
26 $cv->recv();
27  
28 =head1 DESCRIPTION
29  
30 This module provides an L<AnyEvent>-compatible subclass of
31 L<Net::Curl::Promiser>.
32  
33 See F</examples> in the distribution, as well as the tests,
34 for fleshed-out demonstrations.
35  
36 =cut
37  
38 #----------------------------------------------------------------------
39  
40 use parent 'Net::Curl::Promiser::LoopBase';
41  
42 use Net::Curl::Promiser::Backend::AnyEvent ();
43  
44 #----------------------------------------------------------------------
45  
46 sub _INIT {
47 my ($self, $args_ar) = @_;
48  
49 return Net::Curl::Promiser::Backend::AnyEvent->new();
50 }
51  
52 1;