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.429 by root, Sat Sep 17 02:33:54 2016 UTC vs.
Revision 1.430 by root, Fri Nov 11 01:24:20 2016 UTC

995 995
996 $WATCHER ||= $guard; 996 $WATCHER ||= $guard;
997 997
998=item @AnyEvent::post_detect 998=item @AnyEvent::post_detect
999 999
1000If there are any code references in this array (you can C<push> to it 1000This is a lower level interface then C<AnyEvent::post_detect> (the
1001function). This variable is mainly useful for modules that can do
1002something useful when AnyEvent is used and thus want to know when it
1003is initialised, but do not need to even load it by default. This array
1004provides the means to hook into AnyEvent passively, without loading it.
1005
1006Here is how it works: If there are any code references in this array (you
1001before or after loading AnyEvent), then they will be called directly 1007can C<push> to it before or after loading AnyEvent), then they will be
1002after the event loop has been chosen. 1008called directly after the event loop has been chosen.
1003 1009
1004You should check C<$AnyEvent::MODEL> before adding to this array, though: 1010You should check C<$AnyEvent::MODEL> before adding to this array, though:
1005if it is defined then the event loop has already been detected, and the 1011if it is defined then the event loop has already been detected, and the
1006array will be ignored. 1012array will be ignored.
1007 1013
1008Best use C<AnyEvent::post_detect { BLOCK }> when your application allows 1014Best use C<AnyEvent::post_detect { BLOCK }> when your application allows
1009it, as it takes care of these details. 1015it, as it takes care of these details.
1010
1011This variable is mainly useful for modules that can do something useful
1012when AnyEvent is used and thus want to know when it is initialised, but do
1013not need to even load it by default. This array provides the means to hook
1014into AnyEvent passively, without loading it.
1015 1016
1016Example: To load Coro::AnyEvent whenever Coro and AnyEvent are used 1017Example: To load Coro::AnyEvent whenever Coro and AnyEvent are used
1017together, you could put this into Coro (this is the actual code used by 1018together, you could put this into Coro (this is the actual code used by
1018Coro to accomplish this): 1019Coro to accomplish this):
1019 1020

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines