| 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
| |||||||||||
| 49 | 0 | ▶ | eval { require IO::Async::Loop::Ppoll } and return IO::Async::Loop::Ppoll->new; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 50 | 0 | die; | |||||||||
| 51 | } | ||||||||||
| 52 | |||||||||||
| 53 | # Keep perl happy; keep Britain tidy | ||||||||||
| 54 | 1 | 1; | |||||||||
| 55 | |||||||||||
| 56 | __END__ | ||||||||||