ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/AnyEvent-AIO/AIO.pm
(Generate patch)

Comparing AnyEvent-AIO/AIO.pm (file contents):
Revision 1.2 by root, Sun May 11 01:14:47 2008 UTC vs.
Revision 1.3 by root, Tue Jul 21 03:34:20 2009 UTC

34use AnyEvent (); 34use AnyEvent ();
35use IO::AIO (); 35use IO::AIO ();
36 36
37use base Exporter::; 37use base Exporter::;
38 38
39our $VERSION = '1.0'; 39our $VERSION = '1.1';
40our $WATCHER; 40our $WATCHER;
41 41
42$WATCHER = AnyEvent::post_detect { 42my $guard = AnyEvent::post_detect {
43 if ($AnyEvent::MODEL eq "AnyEvent::Impl::EV") {
44 $WATCHER = EV::io (IO::AIO::poll_fileno, &EV::READ, \&IO::AIO::poll_cb);
45 } else {
46 our $FH; open $FH, "<&=" . IO::AIO::poll_fileno;
47 $WATCHER = AnyEvent->io (fh => $FH, poll => 'r', cb => \&IO::AIO::poll_cb); 43 $WATCHER = AnyEvent->io (fh => IO::AIO::poll_fileno, poll => 'r', cb => \&IO::AIO::poll_cb);
48 }
49}; 44};
45$WATCHER ||= $guard;
50 46
51IO::AIO::_on_next_submit \&AnyEvent::detect; 47IO::AIO::_on_next_submit \&AnyEvent::detect;
52 48
53=head1 SEE ALSO 49=head1 SEE ALSO
54 50

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines