--- EV/EV.pm 2007/10/31 18:28:00 1.15 +++ EV/EV.pm 2007/10/31 20:10:17 1.16 @@ -25,8 +25,8 @@ # IO my $w = EV::io \*STDIN, EV::READ | EV::PERSIST, sub { - my ($w, $events) = @_; # all callbacks get the watcher object and event mask - if ($events & EV::TIMEOUT) { + my ($w, $revents) = @_; # all callbacks get the watcher object and event mask + if ($revents & EV::TIMEOUT) { warn "nothing received on stdin for 10 seconds, retrying"; } else { warn "stdin is readable, you entered: ", ; @@ -35,8 +35,8 @@ $w->timeout (10); my $w = EV::timed_io \*STDIN, EV::READ, 30, sub { - my ($w, $events) = @_; - if ($_[1] & EV::TIMEOUT) { + my ($w, $revents) = @_; + if ($revents & EV::TIMEOUT) { warn "nothing entered within 30 seconds, bye bye.\n"; $w->stop; } else { @@ -54,22 +54,25 @@ my $w = EV::signal 3, sub { warn "sigquit received (this is GNU/Linux, right?)\n"; }; + + # CHILD/PID STATUS CHANGES + + my $w = EV::child 666, sub { + my ($w, $revents, $status) = @_; + }; # MAINLOOP EV::dispatch; # loop as long as watchers are active EV::loop; # the same thing - EV::loop EV::LOOP_ONCE; # block until some events could be handles + EV::loop EV::LOOP_ONESHOT; # block until some events could be handles EV::loop EV::LOOP_NONBLOCK; # check and handle some events, but do not wait =head1 DESCRIPTION -This module provides an interface to libevent -(L). You probably should acquaint -yourself with its documentation and source code to be able to use this -module fully. - -Please note thta this module disables the libevent EPOLL method by -default, see BUGS, below, if you need to enable it. +This module provides an interface to libev +(L). You probably should +acquaint yourself with its documentation and source code to be able to use +this module fully. =cut