--- IO-AIO/AIO.pm 2008/05/10 18:06:41 1.123 +++ IO-AIO/AIO.pm 2008/05/29 03:20:40 1.128 @@ -28,9 +28,8 @@ my $grp = aio_group sub { print "all stats done\n" }; add $grp aio_stat "..." for ...; - # AnyEvent integration (EV, Event, Glib, Tk, urxvt, pureperl...) - open my $fh, "<&=" . IO::AIO::poll_fileno or die "$!"; - my $w = AnyEvent->io (fh => $fh, poll => 'r', cb => sub { IO::AIO::poll_cb }); + # AnyEvent integration (EV, Event, Glib, Tk, POE, urxvt, pureperl...) + use AnyEvent::AIO; # EV integration my $w = EV::io IO::AIO::poll_fileno, EV::READ, \&IO::AIO::poll_cb; @@ -196,7 +195,7 @@ use base 'Exporter'; BEGIN { - our $VERSION = '2.62'; + our $VERSION = '3.03'; our @AIO_REQ = qw(aio_sendfile aio_read aio_write aio_open aio_close aio_stat aio_lstat aio_unlink aio_rmdir aio_readdir @@ -1120,12 +1119,14 @@ =item IO::AIO::poll_cb Process some outstanding events on the result pipe. You have to call this -regularly. Returns the number of events processed. Returns immediately -when no events are outstanding. The amount of events processed depends on -the settings of C and C. +regularly. Returns C<0> if all events could be processed, or C<-1> if it +returned earlier for whatever reason. Returns immediately when no events +are outstanding. The amount of events processed depends on the settings of +C and C. If not all requests were processed for whatever reason, the filehandle -will still be ready when C returns. +will still be ready when C returns, so normally you don't have to +do anything special to have it called later. Example: Install an Event watcher that automatically calls IO::AIO::poll_cb with high priority: @@ -1344,7 +1345,8 @@ =head1 SEE ALSO -L. +L for easy integration into event loops, L for a +more natural syntax. =head1 AUTHOR