ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/AnyEvent/lib/AnyEvent.pm
(Generate patch)

Comparing AnyEvent/lib/AnyEvent.pm (file contents):
Revision 1.430 by root, Fri Nov 11 01:24:20 2016 UTC vs.
Revision 1.431 by root, Fri Nov 11 01:54:58 2016 UTC

962 962
963Arranges for the code block to be executed as soon as the event model is 963Arranges for the code block to be executed as soon as the event model is
964autodetected (or immediately if that has already happened). 964autodetected (or immediately if that has already happened).
965 965
966The block will be executed I<after> the actual backend has been detected 966The block will be executed I<after> the actual backend has been detected
967(C<$AnyEvent::MODEL> is set), but I<before> any watchers have been 967(C<$AnyEvent::MODEL> is set), so it is possible to do some initialisation
968created, so it is possible to e.g. patch C<@AnyEvent::ISA> or do 968only when AnyEvent is actually initialised - see the sources of
969other initialisations - see the sources of L<AnyEvent::Strict> or
970L<AnyEvent::AIO> to see how this is used. 969L<AnyEvent::AIO> to see how this is used.
971 970
972The most common usage is to create some global watchers, without forcing 971The most common usage is to create some global watchers, without forcing
973event module detection too early, for example, L<AnyEvent::AIO> creates 972event module detection too early. For example, L<AnyEvent::AIO> creates
974and installs the global L<IO::AIO> watcher in a C<post_detect> block to 973and installs the global L<IO::AIO> watcher in a C<post_detect> block to
975avoid autodetecting the event module at load time. 974avoid autodetecting the event module at load time.
976 975
977If called in scalar or list context, then it creates and returns an object 976If called in scalar or list context, then it creates and returns an object
978that automatically removes the callback again when it is destroyed (or 977that automatically removes the callback again when it is destroyed (or

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines