--- AnyEvent/lib/AnyEvent.pm 2008/04/25 13:39:08 1.83 +++ AnyEvent/lib/AnyEvent.pm 2008/04/25 13:48:42 1.84 @@ -150,13 +150,17 @@ becomes ready. The I/O watcher might use the underlying file descriptor or a copy of it. -It is not allowed to close a file handle as long as any watcher is active -on the underlying file descriptor. +You must not close a file handle as long as any watcher is active on the +underlying file descriptor. Some event loops issue spurious readyness notifications, so you should always use non-blocking calls when reading/writing from/to your file handles. +Although the callback might get passed parameters, their value and +presence is undefined and you cannot rely on them. Portable AnyEvent +callbacks cannot use arguments passed to I/O watcher callbacks. + Example: # wait for readability of STDIN, then read a line and disable the watcher @@ -179,6 +183,10 @@ timer you have to create a new watcher (this is a limitation by both Tk and Glib). +Although the callback might get passed parameters, their value and +presence is undefined and you cannot rely on them. Portable AnyEvent +callbacks cannot use arguments passed to time watcher callbacks. + Example: # fire an event after 7.7 seconds @@ -948,10 +956,9 @@ boost. C is the sole leader regarding speed and memory use, which are both -maximal/minimal, respectively. Even when going through AnyEvent, there are -only two event loops that use slightly less memory (the C module -natively and the pure perl backend), and no faster event models, not even -C natively. +maximal/minimal, respectively. Even when going through AnyEvent, it uses +far less memory than any other event loop and is still faster than Event +natively. The pure perl implementation is hit in a few sweet spots (both the zero timeout and the use of a single fd hit optimisations in the perl