… | |
… | |
878 | AnyEvent::Impl::EventLib based on Event::Lib, leaks memory and worse. |
878 | AnyEvent::Impl::EventLib based on Event::Lib, leaks memory and worse. |
879 | AnyEvent::Impl::POE based on POE, very slow, some limitations. |
879 | AnyEvent::Impl::POE based on POE, very slow, some limitations. |
880 | AnyEvent::Impl::Irssi used when running within irssi. |
880 | AnyEvent::Impl::Irssi used when running within irssi. |
881 | AnyEvent::Impl::IOAsync based on IO::Async. |
881 | AnyEvent::Impl::IOAsync based on IO::Async. |
882 | AnyEvent::Impl::Cocoa based on Cocoa::EventLoop. |
882 | AnyEvent::Impl::Cocoa based on Cocoa::EventLoop. |
883 | AnyEvent::Impl::FLTK2 based on FLTK (fltk 2 binding). |
883 | AnyEvent::Impl::FLTK based on FLTK (fltk 2 binding). |
884 | |
884 | |
885 | =item Backends with special needs. |
885 | =item Backends with special needs. |
886 | |
886 | |
887 | Qt requires the Qt::Application to be instantiated first, but will |
887 | Qt requires the Qt::Application to be instantiated first, but will |
888 | otherwise be picked up automatically. As long as the main program |
888 | otherwise be picked up automatically. As long as the main program |
… | |
… | |
1058 | If L<AnyEvent::Log> is not loaded then this function makes a simple test |
1058 | If L<AnyEvent::Log> is not loaded then this function makes a simple test |
1059 | to see whether the message will be logged. If the test succeeds it will |
1059 | to see whether the message will be logged. If the test succeeds it will |
1060 | load AnyEvent::Log and call C<AnyEvent::Log::log> - consequently, look at |
1060 | load AnyEvent::Log and call C<AnyEvent::Log::log> - consequently, look at |
1061 | the L<AnyEvent::Log> documentation for details. |
1061 | the L<AnyEvent::Log> documentation for details. |
1062 | |
1062 | |
1063 | If the test fails it will simply return. |
1063 | If the test fails it will simply return. Right now this happens when a |
|
|
1064 | numerical loglevel is used and it is larger than the level specified via |
|
|
1065 | C<$ENV{PERL_ANYEVENT_VERBOSE}>. |
1064 | |
1066 | |
1065 | If you want to sprinkle loads of logging calls around your code, consider |
1067 | If you want to sprinkle loads of logging calls around your code, consider |
1066 | creating a logger callback with the C<AnyEvent::Log::logger> function, |
1068 | creating a logger callback with the C<AnyEvent::Log::logger> function, |
1067 | which can reduce typing, codesize and can reduce the logging overhead |
1069 | which can reduce typing, codesize and can reduce the logging overhead |
1068 | enourmously. |
1070 | enourmously. |
… | |
… | |
1233 | |
1235 | |
1234 | BEGIN { AnyEvent::common_sense } |
1236 | BEGIN { AnyEvent::common_sense } |
1235 | |
1237 | |
1236 | use Carp (); |
1238 | use Carp (); |
1237 | |
1239 | |
1238 | our $VERSION = '6.01'; |
1240 | our $VERSION = '6.02'; |
1239 | our $MODEL; |
1241 | our $MODEL; |
1240 | |
1242 | |
1241 | our @ISA; |
1243 | our @ISA; |
1242 | |
1244 | |
1243 | our @REGISTRY; |
1245 | our @REGISTRY; |
… | |
… | |
1256 | for grep s/^AE_// && !exists $ENV{"PERL_ANYEVENT_$_"}, keys %ENV; |
1258 | for grep s/^AE_// && !exists $ENV{"PERL_ANYEVENT_$_"}, keys %ENV; |
1257 | |
1259 | |
1258 | @ENV{grep /^PERL_ANYEVENT_/, keys %ENV} = () |
1260 | @ENV{grep /^PERL_ANYEVENT_/, keys %ENV} = () |
1259 | if ${^TAINT}; |
1261 | if ${^TAINT}; |
1260 | |
1262 | |
1261 | $VERBOSE = $ENV{PERL_ANYEVENT_VERBOSE}*1; |
1263 | # $ENV{PERL_ANYEVENT_xxx} now valid |
|
|
1264 | |
|
|
1265 | $VERBOSE = length $ENV{PERL_ANYEVENT_VERBOSE} ? $ENV{PERL_ANYEVENT_VERBOSE}*1 : 3; |
1262 | } |
1266 | } |
1263 | |
1267 | |
1264 | our $MAX_SIGNAL_LATENCY = 10; |
1268 | our $MAX_SIGNAL_LATENCY = 10; |
1265 | |
1269 | |
1266 | our %PROTOCOL; # (ipv4|ipv6) => (1|2), higher numbers are preferred |
1270 | our %PROTOCOL; # (ipv4|ipv6) => (1|2), higher numbers are preferred |
… | |
… | |
1336 | [POE::Kernel:: => AnyEvent::Impl::POE::], # lasciate ogni speranza |
1340 | [POE::Kernel:: => AnyEvent::Impl::POE::], # lasciate ogni speranza |
1337 | [Wx:: => AnyEvent::Impl::POE::], |
1341 | [Wx:: => AnyEvent::Impl::POE::], |
1338 | [Prima:: => AnyEvent::Impl::POE::], |
1342 | [Prima:: => AnyEvent::Impl::POE::], |
1339 | [IO::Async::Loop:: => AnyEvent::Impl::IOAsync::], # a bitch to autodetect |
1343 | [IO::Async::Loop:: => AnyEvent::Impl::IOAsync::], # a bitch to autodetect |
1340 | [Cocoa::EventLoop:: => AnyEvent::Impl::Cocoa::], |
1344 | [Cocoa::EventLoop:: => AnyEvent::Impl::Cocoa::], |
1341 | [FLTK:: => AnyEvent::Impl::FLTK2::], |
1345 | [FLTK:: => AnyEvent::Impl::FLTK::], |
1342 | ); |
1346 | ); |
1343 | |
1347 | |
1344 | our @isa_hook; |
1348 | our @isa_hook; |
1345 | |
1349 | |
1346 | sub _isa_set { |
1350 | sub _isa_set { |
… | |
… | |
2040 | |
2044 | |
2041 | =over 4 |
2045 | =over 4 |
2042 | |
2046 | |
2043 | =item C<PERL_ANYEVENT_VERBOSE> |
2047 | =item C<PERL_ANYEVENT_VERBOSE> |
2044 | |
2048 | |
2045 | By default, AnyEvent will be completely silent except in fatal |
2049 | By default, AnyEvent will only log messages with loglevel C<3> |
2046 | conditions. You can set this environment variable to make AnyEvent more |
2050 | (C<critical>) or higher (see L<AnyEvent::Log>). You can set this |
|
|
2051 | environment variable to a numerical loglevel to make AnyEvent more (or |
|
|
2052 | less) talkative. |
|
|
2053 | |
2047 | talkative. If you want to do more than just set the global logging level |
2054 | If you want to do more than just set the global logging level |
2048 | you should have a look at C<PERL_ANYEVENT_LOG>, which allows much more |
2055 | you should have a look at C<PERL_ANYEVENT_LOG>, which allows much more |
2049 | complex specifications. |
2056 | complex specifications. |
2050 | |
2057 | |
|
|
2058 | When set to C<0> (C<off>), then no messages whatsoever will be logged with |
|
|
2059 | the default logging settings. |
|
|
2060 | |
2051 | When set to C<5> or higher (warn), causes AnyEvent to warn about unexpected |
2061 | When set to C<5> or higher (C<warn>), causes AnyEvent to warn about |
2052 | conditions, such as not being able to load the event model specified by |
2062 | unexpected conditions, such as not being able to load the event model |
2053 | C<PERL_ANYEVENT_MODEL>, or a guard callback throwing an exception - this |
2063 | specified by C<PERL_ANYEVENT_MODEL>, or a guard callback throwing an |
2054 | is the minimum recommended level. |
2064 | exception - this is the minimum recommended level. |
2055 | |
2065 | |
2056 | When set to C<7> or higher (info), cause AnyEvent to report which event model it |
2066 | When set to C<7> or higher (info), cause AnyEvent to report which event model it |
2057 | chooses. |
2067 | chooses. |
2058 | |
2068 | |
2059 | When set to C<8> or higher (debug), then AnyEvent will report extra information on |
2069 | When set to C<8> or higher (debug), then AnyEvent will report extra information on |