--- EV/README 2007/10/29 19:53:21 1.4 +++ EV/README 2007/11/01 13:33:12 1.5 @@ -23,8 +23,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: ", ; @@ -33,8 +33,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 { @@ -52,21 +52,24 @@ 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 DESCRIPTION - This module provides an interface to libevent - (). 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 + (). You probably should + acquaint yourself with its documentation and source code to be able to + use this module fully. BASIC INTERFACE $EV::NPRI @@ -232,17 +235,9 @@ Set the priority of the watcher to $priority (0 <= $priority < $EV::NPRI). -BUGS - Lots. Libevent itself isn't well tested and rather buggy, and this - module is quite new at the moment. - - Please note that the epoll method is not, in general, reliable in - programs that use fork (even if no libveent calls are being made in the - forked process). If your program behaves erratically, try setting the - environment variable "EVENT_NOEPOLL" first when running the program. - - In general, if you fork, then you can only use the EV module in one of - the children. +THREADS + Threads are not supported by this in any way. Perl pseudo-threads is + evil and must die. SEE ALSO L, L, L, L.