--- cvsroot/EV/EV.pm 2007/11/09 19:33:51 1.33 +++ cvsroot/EV/EV.pm 2007/11/12 07:58:52 1.37 @@ -12,8 +12,8 @@ warn "is called after 2s"; }; - my $w = EV::timer 2, 1, sub { - warn "is called roughly every 2s (repeat = 1)"; + my $w = EV::timer 2, 2, sub { + warn "is called roughly every 2s (repeat = 2)"; }; undef $w; # destroy event watcher again @@ -25,7 +25,7 @@ # IO my $w = EV::io *STDIN, EV::READ, sub { - my ($w, $revents) = @_; # all callbacks get the watcher object and event mask + my ($w, $revents) = @_; # all callbacks receive the watcher and event mask warn "stdin is readable, you entered: ", ; }; @@ -35,20 +35,15 @@ warn "sigquit received\n"; }; - 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) = @_; - # my $pid = $w->rpid; my $status = $w->rstatus; }; # MAINLOOP - EV::loop; # loop until EV::loop_done is called + EV::loop; # loop until EV::loop_done is called or all watchers stop EV::loop EV::LOOP_ONESHOT; # block until at least one event could be handled EV::loop EV::LOOP_NONBLOCK; # try to handle same events, but do not block @@ -64,7 +59,7 @@ use strict; BEGIN { - our $VERSION = '0.6'; + our $VERSION = '0.8'; use XSLoader; XSLoader::load "EV", $VERSION; } @@ -343,10 +338,10 @@ =item * manual reschedule mode ($reschedule_cb = coderef) -In this mode $interval and $at are both being ignored. Instead, each time -the periodic watcher gets scheduled, the first callback ($reschedule_cb) -will be called with the watcher as first, and the current time as second -argument. +In this mode $interval and $at are both being ignored. Instead, each +time the periodic watcher gets scheduled, the reschedule callback +($reschedule_cb) will be called with the watcher as first, and the current +time as second argument. I. If you need to stop it, return 1e30 and stop it