--- cvsroot/EV/EV.pm 2007/12/07 18:11:21 1.63 +++ cvsroot/EV/EV.pm 2007/12/20 07:12:57 1.72 @@ -70,7 +70,7 @@ use strict; BEGIN { - our $VERSION = '1.71'; + our $VERSION = '2.0'; use XSLoader; XSLoader::load "EV", $VERSION; } @@ -88,6 +88,8 @@ @EV::Fork::ISA = "EV::Watcher"; +@EV::Loop::Default::ISA = "EV::Loop"; + =head1 BASIC INTERFACE =over 4 @@ -95,7 +97,7 @@ =item $EV::DIED Must contain a reference to a function that is called when a callback -throws an exception (with $@ containing thr error). The default prints an +throws an exception (with $@ containing the error). The default prints an informative message and continues. If this callback throws an exception it will be silently ignored. @@ -162,8 +164,20 @@ of them triggers, then they will be stopped and freed, and the callback invoked. +=item EV::feed_fd_event ($fd, $revents) + +Feed an event on a file descriptor into EV. EV will react to this call as +if the readyness notifications specified by C<$revents> (a combination of +C and C) happened on the file descriptor C<$fd>. + +=item EV::feed_signal_event ($signal) + +Feed a signal event into EV. EV will react to this call as if the signal +specified by C<$signal> had occured. + =back + =head2 WATCHER OBJECTS A watcher is an object that gets created to record your interest in some @@ -255,10 +269,21 @@ Note that the priority semantics have not yet been fleshed out and are subject to almost certain change. -=item $w->trigger ($revents) +=item $w->invoke ($revents) Call the callback *now* with the given event mask. +=item $w->feed_event ($revents) + +Feed some events on this watcher into EV. EV will react to this call as if +the watcher had received the given C<$revents> mask. + +=item $revents = $w->clear_pending + +If the watcher is pending, this function returns clears its pending status +and returns its C<$revents> bitset (as if its callback was invoked). If the +watcher isn't pending it does nothing and returns C<0>. + =item $previous_state = $w->keepalive ($bool) Normally, C will return when there are no active watchers @@ -473,6 +498,10 @@ Simply stops and starts the watcher again. +=item $time = $w->at + +Return the time that the watcher is expected to trigger next. + =back @@ -817,7 +846,7 @@ }; default_loop - or die 'EV: cannot initialise libev backend. bad $ENV{LIBEV_METHODS}?'; + or die 'EV: cannot initialise libev backend. bad $ENV{LIBEV_FLAGS}?'; 1;