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.291 by root, Thu Sep 3 13:59:20 2009 UTC vs.
Revision 1.297 by root, Thu Nov 19 01:55:57 2009 UTC

362this "current" time will differ substantially from the real time, which 362this "current" time will differ substantially from the real time, which
363might affect timers and time-outs. 363might affect timers and time-outs.
364 364
365When this is the case, you can call this method, which will update the 365When this is the case, you can call this method, which will update the
366event loop's idea of "current time". 366event loop's idea of "current time".
367
368A typical example would be a script in a web server (e.g. C<mod_perl>) -
369when mod_perl executes the script, then the event loop will have the wrong
370idea about the "current time" (being potentially far in the past, when the
371script ran the last time). In that case you should arrange a call to C<<
372AnyEvent->now_update >> each time the web server process wakes up again
373(e.g. at the start of your script, or in a handler).
367 374
368Note that updating the time I<might> cause some events to be handled. 375Note that updating the time I<might> cause some events to be handled.
369 376
370=back 377=back
371 378
1116 1123
1117BEGIN { AnyEvent::common_sense } 1124BEGIN { AnyEvent::common_sense }
1118 1125
1119use Carp (); 1126use Carp ();
1120 1127
1121our $VERSION = '5.12'; 1128our $VERSION = '5.21';
1122our $MODEL; 1129our $MODEL;
1123 1130
1124our $AUTOLOAD; 1131our $AUTOLOAD;
1125our @ISA; 1132our @ISA;
1126 1133
1127our @REGISTRY; 1134our @REGISTRY;
1128
1129our $WIN32;
1130 1135
1131our $VERBOSE; 1136our $VERBOSE;
1132 1137
1133BEGIN { 1138BEGIN {
1134 eval "sub WIN32(){ " . (($^O =~ /mswin32/i)*1) ." }"; 1139 eval "sub WIN32(){ " . (($^O =~ /mswin32/i)*1) ." }";
1386our ($SIG_COUNT, $SIG_TW); 1391our ($SIG_COUNT, $SIG_TW);
1387 1392
1388sub _signal_exec { 1393sub _signal_exec {
1389 $HAVE_ASYNC_INTERRUPT 1394 $HAVE_ASYNC_INTERRUPT
1390 ? $SIGPIPE_R->drain 1395 ? $SIGPIPE_R->drain
1391 : sysread $SIGPIPE_R, my $dummy, 9; 1396 : sysread $SIGPIPE_R, (my $dummy), 9;
1392 1397
1393 while (%SIG_EV) { 1398 while (%SIG_EV) {
1394 for (keys %SIG_EV) { 1399 for (keys %SIG_EV) {
1395 delete $SIG_EV{$_}; 1400 delete $SIG_EV{$_};
1396 $_->() for values %{ $SIG_CB{$_} || {} }; 1401 $_->() for values %{ $SIG_CB{$_} || {} };

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines