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

Comparing EV/EV.pm (file contents):
Revision 1.81 by root, Mon Dec 31 00:59:34 2007 UTC vs.
Revision 1.82 by root, Fri Jan 25 15:45:08 2008 UTC

35 warn "sigquit received\n"; 35 warn "sigquit received\n";
36 }; 36 };
37 37
38 # CHILD/PID STATUS CHANGES 38 # CHILD/PID STATUS CHANGES
39 39
40 my $w = EV::child 666, sub { 40 my $w = EV::child 666, 0, sub {
41 my ($w, $revents) = @_; 41 my ($w, $revents) = @_;
42 my $status = $w->rstatus; 42 my $status = $w->rstatus;
43 }; 43 };
44 44
45 # STAT CHANGES 45 # STAT CHANGES
644 644
645=head3 CHILD WATCHERS - watch out for process status changes 645=head3 CHILD WATCHERS - watch out for process status changes
646 646
647=over 4 647=over 4
648 648
649=item $w = EV::child $pid, $callback 649=item $w = EV::child $pid, $trace, $callback
650 650
651=item $w = EV::child_ns $pid, $callback 651=item $w = EV::child_ns $pid, $trace, $callback
652 652
653=item $w = $loop->child ($pid, $callback) 653=item $w = $loop->child ($pid, $trace, $callback)
654 654
655=item $w = $loop->child_ns ($pid, $callback) 655=item $w = $loop->child_ns ($pid, $trace, $callback)
656 656
657Call the callback when a status change for pid C<$pid> (or any pid if 657Call the callback when a status change for pid C<$pid> (or any pid
658C<$pid> is 0) has been received. More precisely: when the process receives 658if C<$pid> is 0) has been received (a status change happens when the
659process terminates or is killed, or, when trace is true, additionally when
660it is stopped or continued). More precisely: when the process receives
659a C<SIGCHLD>, EV will fetch the outstanding exit/wait status for all 661a C<SIGCHLD>, EV will fetch the outstanding exit/wait status for all
660changed/zombie children and call the callback. 662changed/zombie children and call the callback.
661 663
662It is valid (and fully supported) to install a child watcher after a child 664It is valid (and fully supported) to install a child watcher after a child
663has exited but before the event loop has started its next iteration (for 665has exited but before the event loop has started its next iteration (for
670You can have as many pid watchers per pid as you want, they will all be 672You can have as many pid watchers per pid as you want, they will all be
671called. 673called.
672 674
673The C<child_ns> variant doesn't start (activate) the newly created watcher. 675The C<child_ns> variant doesn't start (activate) the newly created watcher.
674 676
675=item $w->set ($pid) 677=item $w->set ($pid, $trace)
676 678
677Reconfigures the watcher, see the constructor above for details. Can be called at 679Reconfigures the watcher, see the constructor above for details. Can be called at
678any time. 680any time.
679 681
680=item $current_pid = $w->pid 682=item $current_pid = $w->pid
681
682=item $old_pid = $w->pid ($new_pid)
683 683
684Returns the previously set process id and optionally set a new one. 684Returns the previously set process id and optionally set a new one.
685 685
686=item $exit_status = $w->rstatus 686=item $exit_status = $w->rstatus
687 687

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines