blib/lib/IO/Async/Loop/linux.pm

filter: Statementstmt 57.1% 8 / 14 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 66.6% 2 / 3 Podpod 0.0% 0 / 1 totaltotal 45.4% 10 / 22 CC 3 SCAR 20.3
CC
3
Cov
44%
new
12.0
BEGIN
1.0
BEGIN
1.0
CRAP 7.6
↑ Summary
1 # You may distribute under the terms of either the GNU General Public License
2 # or the Artistic License (the same terms as Perl itself)
3 #
4 # (C) Paul Evans, 2009 -- leonerd@leonerd.org.uk
5  
6 package IO::Async::Loop::linux;
7  
8 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 1 our $VERSION = '0.04';
12  
13 =head1 NAME
14  
15 C<IO::Async::Loop::linux> - pick the best Loop implementation on Linux
16  
17 =head1 DESCRIPTION
18  
19 If this module is installed, then the best Loop implementation will
20 automatically be picked when C<< IO::Async::Loop->new() >> is called on a
21 Linux machine. It will attempt to use either of the following, in order, if
22 they are available
23  
24 =over 4
25  
26 =item *
27  
28 L<IO::Async::Loop::Epoll>
29  
30 =item *
31  
32 L<IO::Async::Loop::Ppoll>
33  
34 =back
35  
36 The end application using L<IO::Async> does not need to make any special
37 effort to use these; the magic constructor in L<IO::Async::Loop> will
38 automatically find and use it if it is installed.
39  
40 $ perl -MIO::Async::Loop -E 'say ref IO::Async::Loop->new'
41 IO::Async::Loop::Epoll
42  
43 =cut
44  
45 sub new
46 0 ▶{
Subroutine new: not called CC=3 SCAR=24.8
Pod undocumented
47 0 shift;
48 0 ▶ eval { require IO::Async::Loop::Epoll } and return IO::Async::Loop::Epoll->new;
Branch: 1 branch
BranchTrueFalseTotal
eval { do { require IO::Async::Loop::Epoll } } and return "IO::Async::Loop::Epoll"->new 0 0 0
49 0 ▶ eval { require IO::Async::Loop::Ppoll } and return IO::Async::Loop::Ppoll->new;
Branch: 1 branch
BranchTrueFalseTotal
eval { do { require IO::Async::Loop::Ppoll } } and return "IO::Async::Loop::Ppoll"->new 0 0 0
50 0 die;
51 }
52  
53 # Keep perl happy; keep Britain tidy
54 1 1;
55  
56 __END__
↑ Summary