… | |
… | |
48 | EV::loop EV::LOOP_NONBLOCK; # try to handle same events, but do not block |
48 | EV::loop EV::LOOP_NONBLOCK; # try to handle same events, but do not block |
49 | |
49 | |
50 | =head1 DESCRIPTION |
50 | =head1 DESCRIPTION |
51 | |
51 | |
52 | This module provides an interface to libev |
52 | This module provides an interface to libev |
53 | (L<http://software.schmorp.de/pkg/libev.html>). |
53 | (L<http://software.schmorp.de/pkg/libev.html>). While the documentation |
|
|
54 | below is comprehensive, one might also consult the documentation of libev |
|
|
55 | itself (L<http://cvs.schmorp.de/libev/ev.html>) for more subtle details on |
|
|
56 | watcher semantics or some discussion on the available backends, or how to |
|
|
57 | force a specific backend with C<LIBEV_FLAGS>. |
54 | |
58 | |
55 | =cut |
59 | =cut |
56 | |
60 | |
57 | package EV; |
61 | package EV; |
58 | |
62 | |
… | |
… | |
306 | |
310 | |
307 | =item $w = EV::timer $after, $repeat, $callback |
311 | =item $w = EV::timer $after, $repeat, $callback |
308 | |
312 | |
309 | =item $w = EV::timer_ns $after, $repeat, $callback |
313 | =item $w = EV::timer_ns $after, $repeat, $callback |
310 | |
314 | |
311 | Calls the callback after C<$after> seconds. If C<$repeat> is non-zero, |
315 | Calls the callback after C<$after> seconds (which may be fractional). If |
312 | the timer will be restarted (with the $repeat value as $after) after the |
316 | C<$repeat> is non-zero, the timer will be restarted (with the $repeat |
313 | callback returns. |
317 | value as $after) after the callback returns. |
314 | |
318 | |
315 | This means that the callback would be called roughly after C<$after> |
319 | This means that the callback would be called roughly after C<$after> |
316 | seconds, and then every C<$repeat> seconds. The timer does his best not |
320 | seconds, and then every C<$repeat> seconds. The timer does his best not |
317 | to drift, but it will not invoke the timer more often then once per event |
321 | to drift, but it will not invoke the timer more often then once per event |
318 | loop iteration, and might drift in other cases. If that isn't acceptable, |
322 | loop iteration, and might drift in other cases. If that isn't acceptable, |