AnyEvent 7 coming soon, care to test it?
schmorp at schmorp.de
Sun Apr 8 05:45:05 CEST 2012
AnyEvent 7 is coming soon to a cpan mirror near you.
It's main feature (that resulted in a major version bump) is AnyEvent::IO,
which exports functions to open, read, unlink etc. files and directories,
more or less every filesystem operation perl has built-ins for.
The advantage of going via AnyEvent::IO is that it will be asynchronous, if
IO::AIO is available. If it's not, it will fall back to a comparatively lean
pure-perl implementation that simply calls the perl built-in function in
The rationale for having Anyevent::IO is that AnyEvent has a few areas
where it does I/O itself (for example, for loading /etc/hosts or for
logging), and these things could not be used in some types of programs
that need to maintain low latencies.
Now they can, and if you care about these things, now you can do so as wlel
in your modules.
The following areas of AnyEvent itself use it:
- loading of /etc/hosts (which will be re-checked on each access too instead
of loading it only once at program startup).
- loading of /etc/resolv.conf in Anyevent::DNS.
- logging to disk via AnyEvent::Log (e.g. AE_LOG=log=file=/tmp/mylog.txt).
The code for these is rather complicated (I wish I could depend on Coro for
these, it would simplify things considerably :), and it would be nice if
somebody could gave them a tets, or simply try to install cirrent
CVS-AnyEvent and see that it still works.
To get a current copy, you need to:
cvs -z3 -d :pserver:anonymous at cvs.schmorp.de/schmorpforge co AnyEvent
If it works, I would be thankful for a notice. If it doesn't work even
more so :)
The important Changes so far include:
- child watchers are broken in POE 1.352 (also many earlier
versions) and there seems to be no way to work around it, as POE
itself is inherently racy. Document this regression and add a delay
second in t/68_poe_03_child.t for the time being.
- new module AnyEvent::IO, that is a frontend to either a pure-perl
synchronous I/O implementation (AnyEvent::IO::Perl), or to the
asynchronous I/O extension IO::AIO (AnyEvent::IO::IOAIO).
- load /etc/hosts only when dns has no answer.
- stat /etc/hosts on every access and reload it if it changed.
- load /etc/hosts via AnyEvent::IO - potentially asynchronous.
- AnyEvent::Log log_to_file and log_to_path now use AnyEvent::IO. As
a side effect, they now use true appending as opposed to libc
appending, and the file might not have been opened when the function
- the default logging level was not properly documented in a variety of
places, this has hopefully been rectified.
- updated uts46data.pl for unicode 6.1.0.
- made log messages genearted by AnyEvent submodules not
include the package name anymore, as it will be logged
by default already.
- upgrade to the trick used by common-sense 3.5 to work
around extra warning torture/breakage under perl 5.15.x.
- log messages by anyevent are now ucfirst, are usually full
sentences and do no longer include the package name.
- the storable read type would sometimes throw an exception instead
of causing EBADMSG (analyzed by Maxime Soulé).
- work around a bug in openssl 1.0.1 which enforces a minimum rsa
keysize (reported by Paul Howarth).
The choice of a Deliantra, the free code+content MORPG
-----==- _GNU_ http://www.deliantra.net
----==-- _ generation
---==---(_)__ __ ____ __ Marc Lehmann
--==---/ / _ \/ // /\ \/ / schmorp at schmorp.de
More information about the anyevent