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

Comparing EV/EV.pm (file contents):
Revision 1.79 by root, Sat Dec 22 16:37:07 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
68package EV; 68package EV;
69 69
70use strict; 70use strict;
71 71
72BEGIN { 72BEGIN {
73 our $VERSION = '2.0'; 73 our $VERSION = '2.01';
74 use XSLoader; 74 use XSLoader;
75 XSLoader::load "EV", $VERSION; 75 XSLoader::load "EV", $VERSION;
76} 76}
77 77
78@EV::IO::ISA = 78@EV::IO::ISA =
155 155
156Returns the set (see C<EV::BACKEND_*> flags) of backends supported by this 156Returns the set (see C<EV::BACKEND_*> flags) of backends supported by this
157instance of EV, the set of recommended backends (supposed to be good) for 157instance of EV, the set of recommended backends (supposed to be good) for
158this platform and the set of embeddable backends (see EMBED WATCHERS). 158this platform and the set of embeddable backends (see EMBED WATCHERS).
159 159
160=item EV::sleep $seconds
161
162Block the process for the given number of (fractional) seconds.
163
160=item $time = EV::time 164=item $time = EV::time
161 165
162Returns the current time in (fractional) seconds since the epoch. 166Returns the current time in (fractional) seconds since the epoch.
163 167
164=item $time = EV::now 168=item $time = EV::now
640 644
641=head3 CHILD WATCHERS - watch out for process status changes 645=head3 CHILD WATCHERS - watch out for process status changes
642 646
643=over 4 647=over 4
644 648
645=item $w = EV::child $pid, $callback 649=item $w = EV::child $pid, $trace, $callback
646 650
647=item $w = EV::child_ns $pid, $callback 651=item $w = EV::child_ns $pid, $trace, $callback
648 652
649=item $w = $loop->child ($pid, $callback) 653=item $w = $loop->child ($pid, $trace, $callback)
650 654
651=item $w = $loop->child_ns ($pid, $callback) 655=item $w = $loop->child_ns ($pid, $trace, $callback)
652 656
653Call 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
654C<$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
655a 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
656changed/zombie children and call the callback. 662changed/zombie children and call the callback.
657 663
658It 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
659has 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
666You 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
667called. 673called.
668 674
669The 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.
670 676
671=item $w->set ($pid) 677=item $w->set ($pid, $trace)
672 678
673Reconfigures 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
674any time. 680any time.
675 681
676=item $current_pid = $w->pid 682=item $current_pid = $w->pid
677
678=item $old_pid = $w->pid ($new_pid)
679 683
680Returns the previously set process id and optionally set a new one. 684Returns the previously set process id and optionally set a new one.
681 685
682=item $exit_status = $w->rstatus 686=item $exit_status = $w->rstatus
683 687

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines