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.1 by root, Sat May 10 20:04:13 2008 UTC vs.
Revision 1.3 by root, Tue Jul 21 03:34:20 2009 UTC

1=head1 NAME 1=head1 NAME
2 2
3AnyEvent::AIO - truly asynchronous file and directrory I/O 3AnyEvent::AIO - truly asynchronous file and directory I/O
4 4
5=head1 SYNOPSIS 5=head1 SYNOPSIS
6 6
7 use AnyEvent::AIO; 7 use AnyEvent::AIO;
8 use IO::AIO; 8 use IO::AIO;
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