--- EV/README 2007/11/08 17:02:10 1.8 +++ EV/README 2007/11/12 01:23:21 1.9 @@ -11,8 +11,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 @@ -24,7 +24,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: ", ; }; @@ -34,20 +34,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