… | |
… | |
362 | this "current" time will differ substantially from the real time, which |
362 | this "current" time will differ substantially from the real time, which |
363 | might affect timers and time-outs. |
363 | might affect timers and time-outs. |
364 | |
364 | |
365 | When this is the case, you can call this method, which will update the |
365 | When this is the case, you can call this method, which will update the |
366 | event loop's idea of "current time". |
366 | event loop's idea of "current time". |
|
|
367 | |
|
|
368 | A typical example would be a script in a web server (e.g. C<mod_perl>) - |
|
|
369 | when mod_perl executes the script, then the event loop will have the wrong |
|
|
370 | idea about the "current time" (being potentially far in the past, when the |
|
|
371 | script ran the last time). In that case you should arrange a call to C<< |
|
|
372 | AnyEvent->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 | |
368 | Note that updating the time I<might> cause some events to be handled. |
375 | Note that updating the time I<might> cause some events to be handled. |
369 | |
376 | |
370 | =back |
377 | =back |
371 | |
378 | |
… | |
… | |
1116 | |
1123 | |
1117 | BEGIN { AnyEvent::common_sense } |
1124 | BEGIN { AnyEvent::common_sense } |
1118 | |
1125 | |
1119 | use Carp (); |
1126 | use Carp (); |
1120 | |
1127 | |
1121 | our $VERSION = '5.12'; |
1128 | our $VERSION = '5.202'; |
1122 | our $MODEL; |
1129 | our $MODEL; |
1123 | |
1130 | |
1124 | our $AUTOLOAD; |
1131 | our $AUTOLOAD; |
1125 | our @ISA; |
1132 | our @ISA; |
1126 | |
1133 | |
… | |
… | |
1386 | our ($SIG_COUNT, $SIG_TW); |
1393 | our ($SIG_COUNT, $SIG_TW); |
1387 | |
1394 | |
1388 | sub _signal_exec { |
1395 | sub _signal_exec { |
1389 | $HAVE_ASYNC_INTERRUPT |
1396 | $HAVE_ASYNC_INTERRUPT |
1390 | ? $SIGPIPE_R->drain |
1397 | ? $SIGPIPE_R->drain |
1391 | : sysread $SIGPIPE_R, my $dummy, 9; |
1398 | : sysread $SIGPIPE_R, (my $dummy), 9; |
1392 | |
1399 | |
1393 | while (%SIG_EV) { |
1400 | while (%SIG_EV) { |
1394 | for (keys %SIG_EV) { |
1401 | for (keys %SIG_EV) { |
1395 | delete $SIG_EV{$_}; |
1402 | delete $SIG_EV{$_}; |
1396 | $_->() for values %{ $SIG_CB{$_} || {} }; |
1403 | $_->() for values %{ $SIG_CB{$_} || {} }; |
… | |
… | |
2473 | lot less memory), but otherwise doesn't affect guard operation much. It is |
2480 | lot less memory), but otherwise doesn't affect guard operation much. It is |
2474 | purely used for performance. |
2481 | purely used for performance. |
2475 | |
2482 | |
2476 | =item L<JSON> and L<JSON::XS> |
2483 | =item L<JSON> and L<JSON::XS> |
2477 | |
2484 | |
2478 | This module is required when you want to read or write JSON data via |
2485 | One of these modules is required when you want to read or write JSON data |
2479 | L<AnyEvent::Handle>. It is also written in pure-perl, but can take |
2486 | via L<AnyEvent::Handle>. It is also written in pure-perl, but can take |
2480 | advantage of the ultra-high-speed L<JSON::XS> module when it is installed. |
2487 | advantage of the ultra-high-speed L<JSON::XS> module when it is installed. |
2481 | |
2488 | |
2482 | In fact, L<AnyEvent::Handle> will use L<JSON::XS> by default if it is |
2489 | In fact, L<AnyEvent::Handle> will use L<JSON::XS> by default if it is |
2483 | installed. |
2490 | installed. |
2484 | |
2491 | |