ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/EV/EV.pm
(Generate patch)

Comparing EV/EV.pm (file contents):
Revision 1.120 by root, Sun Jul 19 01:36:34 2009 UTC vs.
Revision 1.125 by root, Thu Dec 31 06:59:47 2009 UTC

79package EV; 79package EV;
80 80
81use common::sense; 81use common::sense;
82 82
83BEGIN { 83BEGIN {
84 our $VERSION = '3.8'; 84 our $VERSION = '3.9';
85 use XSLoader; 85 use XSLoader;
86 XSLoader::load "EV", $VERSION; 86 XSLoader::load "EV", $VERSION;
87} 87}
88 88
89@EV::IO::ISA = 89@EV::IO::ISA =
456 456
457=item $previous_state = $w->keepalive ($bool) 457=item $previous_state = $w->keepalive ($bool)
458 458
459Normally, C<EV::loop> will return when there are no active watchers 459Normally, C<EV::loop> will return when there are no active watchers
460(which is a "deadlock" because no progress can be made anymore). This is 460(which is a "deadlock" because no progress can be made anymore). This is
461convinient because it allows you to start your watchers (and your jobs), 461convenient because it allows you to start your watchers (and your jobs),
462call C<EV::loop> once and when it returns you know that all your jobs are 462call C<EV::loop> once and when it returns you know that all your jobs are
463finished (or they forgot to register some watchers for their task :). 463finished (or they forgot to register some watchers for their task :).
464 464
465Sometimes, however, this gets in your way, for example when the module 465Sometimes, however, this gets in your way, for example when the module
466that calls C<EV::loop> (usually the main program) is not the same module 466that calls C<EV::loop> (usually the main program) is not the same module
698 698
699=item $w = EV::signal $signal, $callback 699=item $w = EV::signal $signal, $callback
700 700
701=item $w = EV::signal_ns $signal, $callback 701=item $w = EV::signal_ns $signal, $callback
702 702
703=item $w = $loop->signal ($signal, $callback)
704
705=item $w = $loop->signal_ns ($signal, $callback)
706
703Call the callback when $signal is received (the signal can be specified by 707Call the callback when $signal is received (the signal can be specified by
704number or by name, just as with C<kill> or C<%SIG>). 708number or by name, just as with C<kill> or C<%SIG>).
709
710Only one event loop can grab a given signal - attempting to grab the same
711signal from two EV loops will crash the program immediately or cause data
712corruption.
705 713
706EV will grab the signal for the process (the kernel only allows one 714EV will grab the signal for the process (the kernel only allows one
707component to receive a signal at a time) when you start a signal watcher, 715component to receive a signal at a time) when you start a signal watcher,
708and removes it again when you stop it. Perl does the same when you 716and removes it again when you stop it. Perl does the same when you
709add/remove callbacks to C<%SIG>, so watch out. 717add/remove callbacks to C<%SIG>, so watch out.

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines