… | |
… | |
433 | as you cannot do race-free signal handling in perl, requiring |
433 | as you cannot do race-free signal handling in perl, requiring |
434 | C libraries for this. AnyEvent will try to do its best, which |
434 | C libraries for this. AnyEvent will try to do its best, which |
435 | means in some cases, signals will be delayed. The maximum time |
435 | means in some cases, signals will be delayed. The maximum time |
436 | a signal might be delayed is 10 seconds by default, but can |
436 | a signal might be delayed is 10 seconds by default, but can |
437 | be overriden via C<$ENV{PERL_ANYEVENT_MAX_SIGNAL_LATENCY}> or |
437 | be overriden via C<$ENV{PERL_ANYEVENT_MAX_SIGNAL_LATENCY}> or |
438 | C<$AnyEvent::MAX_SIGNAL_LATENCY> - see the Ö<ENVIRONMENT VARIABLES> |
438 | C<$AnyEvent::MAX_SIGNAL_LATENCY> - see the L<ENVIRONMENT VARIABLES> |
439 | section for details. |
439 | section for details. |
440 | |
440 | |
441 | All these problems can be avoided by installing the optional |
441 | All these problems can be avoided by installing the optional |
442 | L<Async::Interrupt> module, which works with most event loops. It will not |
442 | L<Async::Interrupt> module, which works with most event loops. It will not |
443 | work with inherently broken event loops such as L<Event> or L<Event::Lib> |
443 | work with inherently broken event loops such as L<Event> or L<Event::Lib> |
… | |
… | |
1233 | |
1233 | |
1234 | BEGIN { AnyEvent::common_sense } |
1234 | BEGIN { AnyEvent::common_sense } |
1235 | |
1235 | |
1236 | use Carp (); |
1236 | use Carp (); |
1237 | |
1237 | |
1238 | our $VERSION = '6.02'; |
1238 | our $VERSION = '6.14'; |
1239 | our $MODEL; |
1239 | our $MODEL; |
1240 | our @ISA; |
1240 | our @ISA; |
1241 | our @REGISTRY; |
1241 | our @REGISTRY; |
1242 | our $VERBOSE; |
1242 | our $VERBOSE; |
1243 | our %PROTOCOL; # (ipv4|ipv6) => (1|2), higher numbers are preferred |
1243 | our %PROTOCOL; # (ipv4|ipv6) => (1|2), higher numbers are preferred |
… | |
… | |
1395 | |
1395 | |
1396 | # IO::Async::Loop::AnyEvent is extremely evil, refuse to work with it |
1396 | # IO::Async::Loop::AnyEvent is extremely evil, refuse to work with it |
1397 | # the author knows about the problems and what it does to AnyEvent as a whole |
1397 | # the author knows about the problems and what it does to AnyEvent as a whole |
1398 | # (and the ability of others to use AnyEvent), but simply wants to abuse AnyEvent |
1398 | # (and the ability of others to use AnyEvent), but simply wants to abuse AnyEvent |
1399 | # anyway. |
1399 | # anyway. |
1400 | AnyEvent::log fatal => "AnyEvent: IO::Async::Loop::AnyEvent detected - this module is broken by design,\n" |
1400 | AnyEvent::log fatal => "AnyEvent: IO::Async::Loop::AnyEvent detected - that module is broken by\n" |
1401 | . "abuses internals and breaks AnyEvent, will not continue." |
1401 | . "design, abuses internals and breaks AnyEvent - will not continue." |
1402 | if exists $INC{"IO/Async/Loop/AnyEvent.pm"}; |
1402 | if exists $INC{"IO/Async/Loop/AnyEvent.pm"}; |
1403 | |
1403 | |
1404 | local $!; # for good measure |
1404 | local $!; # for good measure |
1405 | local $SIG{__DIE__}; # we use eval |
1405 | local $SIG{__DIE__}; # we use eval |
1406 | |
1406 | |
… | |
… | |
1432 | if (${"$package\::VERSION"} > 0) { |
1432 | if (${"$package\::VERSION"} > 0) { |
1433 | if (eval "require $model") { |
1433 | if (eval "require $model") { |
1434 | AnyEvent::log 7 => "autodetected model '$model', using it."; |
1434 | AnyEvent::log 7 => "autodetected model '$model', using it."; |
1435 | $MODEL = $model; |
1435 | $MODEL = $model; |
1436 | last; |
1436 | last; |
|
|
1437 | } else { |
|
|
1438 | AnyEvent::log 8 => "detected event loop $package, but cannot load '$model', skipping: $@"; |
1437 | } |
1439 | } |
1438 | } |
1440 | } |
1439 | } |
1441 | } |
1440 | |
1442 | |
1441 | unless ($MODEL) { |
1443 | unless ($MODEL) { |