--- cvsroot/EV/EV.pm 2007/11/23 05:00:44 1.46 +++ cvsroot/EV/EV.pm 2007/11/23 13:08:55 1.47 @@ -119,6 +119,29 @@ When called with an argument of EV::UNLOOP_ALL, all calls to EV::loop will return as fast as possible. +=item EV::once $fh_or_undef, $events, $timeout, $cb->($events) + +This function rolls together an I/O and a timer watcher for a single +one-shot event without the need for managing a watcher object. + +If C<$fh_or_undef> is a filehandle or file descriptor, then C<$events> +must be a bitset containing either C, C or C, indicating the type of I/O event you want to wait for. If +you do not want to wait for some I/O event, specify C for +C<$fh_or_undef> and C<0> for C<$events>). + +If timeout is C or negative, then there will be no +timeout. Otherwise a EV::timer with this value will be started. + +When an error occurs or either the timeout or I/O watcher triggers, then +the callback will be called with the received event set (in general +you can expect it to be a combination of C, C, +C and C). + +EV::once doesn't return anything: the watchers stay active till either +of them triggers, then they will be stopped and freed, and the callback +invoked. + =back =head2 WATCHER