/usr/lib/perl5/AnyEvent/Impl/EV.pm is in libanyevent-perl 6.120-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 | =head1 NAME
AnyEvent::Impl::EV - AnyEvent adaptor for EV
=head1 SYNOPSIS
use AnyEvent;
use EV;
# this module gets loaded automatically as required
=head1 DESCRIPTION
This module provides transparent support for AnyEvent. You don't have to
do anything to make EV work with AnyEvent except by loading EV before
creating the first AnyEvent watcher.
EV is the fastest event library for perl, and best supported by
AnyEvent. Most functions from the L<AE> API are implemented as direct
aliases to EV functions, so using EV via AE is as fast as using EV
directly.
=cut
package AnyEvent::Impl::EV;
use AnyEvent (); BEGIN { AnyEvent::common_sense }
use EV 4.00;
*AE::time = \&EV::time;
*AE::now = \&EV::now;
*AE::now_update = \&EV::now_update;
*AE::timer = \&EV::timer;
*AE::signal = \&EV::signal;
*AE::idle = \&EV::idle;
# cannot override directly, as EV doesn't allow arguments
sub time { EV::time }
sub now { EV::now }
sub now_update { EV::now_update }
*AE::io = defined &EV::_ae_io # 3.8+, but keep just in case it is dropped
? \&EV::_ae_io
: sub($$$) { EV::io $_[0], $_[1] ? EV::WRITE : EV::READ, $_[2] };
sub timer {
my ($class, %arg) = @_;
EV::timer $arg{after}, $arg{interval}, $arg{cb}
}
sub io {
my ($class, %arg) = @_;
EV::io
$arg{fh},
$arg{poll} eq "r" ? EV::READ : EV::WRITE,
$arg{cb}
}
sub signal {
my ($class, %arg) = @_;
EV::signal $arg{signal}, $arg{cb}
}
sub child {
my ($class, %arg) = @_;
my $cb = $arg{cb};
EV::child $arg{pid}, 0, sub {
$cb->($_[0]->rpid, $_[0]->rstatus);
}
}
sub idle {
my ($class, %arg) = @_;
EV::idle $arg{cb}
}
sub _poll {
EV::run EV::RUN_ONCE;
}
sub AnyEvent::CondVar::Base::_wait {
EV::run EV::RUN_ONCE until exists $_[0]{_ae_sent};
}
#sub loop {
# EV::run;
#}
1;
=head1 SEE ALSO
L<AnyEvent>, L<EV>.
=head1 AUTHOR
Marc Lehmann <schmorp@schmorp.de>
http://home.schmorp.de/
=cut
|