--- AnyEvent/lib/AnyEvent.pm 2012/12/06 12:10:09 1.409 +++ AnyEvent/lib/AnyEvent.pm 2013/09/25 11:16:25 1.415 @@ -273,7 +273,7 @@ my $w = AnyEvent->timer (after => 0.5, interval => 1, cb => sub { warn "timeout\n"; - }; + }); =head3 TIMING ISSUES @@ -747,7 +747,7 @@ sending. The ping example mentioned above is slightly more complicated, as the -there are results to be passwd back, and the number of tasks that are +there are results to be passed back, and the number of tasks that are begun can potentially be zero: my $cv = AnyEvent->condvar; @@ -1149,24 +1149,24 @@ =over 4 -=item L +=item L (part of the AnyEvent distribution) Contains various utility functions that replace often-used blocking functions such as C with event/callback-based versions. -=item L +=item L (part of the AnyEvent distribution) Provides various utility functions for (internet protocol) sockets, addresses and name resolution. Also functions to create non-blocking tcp connections or tcp servers, with IPv6 and SRV record support and more. -=item L +=item L (part of the AnyEvent distribution) Provide read and write buffers, manages watchers for reads and writes, supports raw and formatted I/O, I/O queued and fully transparent and non-blocking SSL/TLS (via L). -=item L +=item L (part of the AnyEvent distribution) Provides rich asynchronous DNS resolver capabilities. @@ -1176,7 +1176,7 @@ the curious, IGS is the International Go Server and FCP is the Freenet Client Protocol). -=item L +=item L (part of the AnyEvent distribution) Truly asynchronous (as opposed to non-blocking) I/O, should be in the toolbox of every event programmer. AnyEvent::AIO transparently fuses @@ -1231,20 +1231,14 @@ package AnyEvent; -# basically a tuned-down version of common::sense -sub common_sense { - # from common:.sense 3.5 - local $^W; - ${^WARNING_BITS} ^= ${^WARNING_BITS} ^ "\x3c\x3f\x33\x00\x0f\xf0\x0f\xc0\xf0\xfc\x33\x00"; - # use strict vars subs - NO UTF-8, as Util.pm doesn't like this atm. (uts46data.pl) - $^H |= 0x00000600; +BEGIN { + require "AnyEvent/constants.pl"; + &AnyEvent::common_sense; } -BEGIN { AnyEvent::common_sense } - use Carp (); -our $VERSION = '7.04'; +our $VERSION = '7.05'; our $MODEL; our @ISA; our @REGISTRY; @@ -1253,8 +1247,6 @@ our $MAX_SIGNAL_LATENCY = $ENV{PERL_ANYEVENT_MAX_SIGNAL_LATENCY} || 10; # executes after the BEGIN block below (tainting!) BEGIN { - require "AnyEvent/constants.pl"; - eval "sub TAINT (){" . (${^TAINT}*1) . "}"; delete @ENV{grep /^PERL_ANYEVENT_/, keys %ENV} @@ -2931,6 +2923,16 @@ pure-perl event loop (L) will additionally load it to try to use a monotonic clock for timing stability. +=item L (and L) + +The default implementation of L is to do I/O synchronously, +stopping programs while they access the disk, which is fine for a lot of +programs. + +Installing AnyEvent::AIO (and its IO::AIO dependency) makes it switch to +a true asynchronous implementation, so event processing can continue even +while waiting for disk I/O. + =back