--- AnyEvent/README 2016/09/17 02:33:54 1.77 +++ AnyEvent/README 2019/02/26 02:08:34 1.79 @@ -828,7 +828,8 @@ reference to the callback after invocation. SUPPORTED EVENT LOOPS/BACKENDS - The available backend classes are (every class has its own manpage): + The following backend classes are part of the AnyEvent distribution + (every class has its own manpage): Backends that are autoprobed when no other event loop can be found. EV is the preferred backend when no other event loop seems to be in @@ -883,6 +884,12 @@ load POE when detecting them, in the hope that POE will pick them up, in which case everything will be automatic. + Known event loops outside the AnyEvent distribution + The following event loops or programs support AnyEvent by providing + their own AnyEvent backend. They will be picked up automatically. + + urxvt::anyevent available to rxvt-unicode extensions + GLOBAL VARIABLES AND FUNCTIONS These are not normally required to use AnyEvent, but can be useful to write AnyEvent extension modules. @@ -916,13 +923,12 @@ model is autodetected (or immediately if that has already happened). The block will be executed *after* the actual backend has been - detected ($AnyEvent::MODEL is set), but *before* any watchers have - been created, so it is possible to e.g. patch @AnyEvent::ISA or do - other initialisations - see the sources of AnyEvent::Strict or - AnyEvent::AIO to see how this is used. + detected ($AnyEvent::MODEL is set), so it is possible to do some + initialisation only when AnyEvent is actually initialised - see the + sources of AnyEvent::AIO to see how this is used. The most common usage is to create some global watchers, without - forcing event module detection too early, for example, AnyEvent::AIO + forcing event module detection too early. For example, AnyEvent::AIO creates and installs the global IO::AIO watcher in a "post_detect" block to avoid autodetecting the event module at load time. @@ -948,9 +954,16 @@ $WATCHER ||= $guard; @AnyEvent::post_detect - If there are any code references in this array (you can "push" to it - before or after loading AnyEvent), then they will be called directly - after the event loop has been chosen. + This is a lower level interface then "AnyEvent::post_detect" (the + function). This variable is mainly useful for modules that can do + something useful when AnyEvent is used and thus want to know when it + is initialised, but do not need to even load it by default. This + array provides the means to hook into AnyEvent passively, without + loading it. + + Here is how it works: If there are any code references in this array + (you can "push" to it before or after loading AnyEvent), then they + will be called directly after the event loop has been chosen. You should check $AnyEvent::MODEL before adding to this array, though: if it is defined then the event loop has already been @@ -959,12 +972,6 @@ Best use "AnyEvent::post_detect { BLOCK }" when your application allows it, as it takes care of these details. - This variable is mainly useful for modules that can do something - useful when AnyEvent is used and thus want to know when it is - initialised, but do not need to even load it by default. This array - provides the means to hook into AnyEvent passively, without loading - it. - Example: To load Coro::AnyEvent whenever Coro and AnyEvent are used together, you could put this into Coro (this is the actual code used by Coro to accomplish this):