ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/EV/EV.pm
(Generate patch)

Comparing EV/EV.pm (file contents):
Revision 1.62 by root, Fri Dec 7 18:09:38 2007 UTC vs.
Revision 1.68 by root, Sun Dec 9 03:54:13 2007 UTC

68package EV; 68package EV;
69 69
70use strict; 70use strict;
71 71
72BEGIN { 72BEGIN {
73 our $VERSION = '1.7'; 73 our $VERSION = '1.72';
74 use XSLoader; 74 use XSLoader;
75 XSLoader::load "EV", $VERSION; 75 XSLoader::load "EV", $VERSION;
76} 76}
77 77
78@EV::IO::ISA = 78@EV::IO::ISA =
93=over 4 93=over 4
94 94
95=item $EV::DIED 95=item $EV::DIED
96 96
97Must contain a reference to a function that is called when a callback 97Must contain a reference to a function that is called when a callback
98throws an exception (with $@ containing thr error). The default prints an 98throws an exception (with $@ containing the error). The default prints an
99informative message and continues. 99informative message and continues.
100 100
101If this callback throws an exception it will be silently ignored. 101If this callback throws an exception it will be silently ignored.
102 102
103=item $time = EV::time 103=item $time = EV::time
160 160
161EV::once doesn't return anything: the watchers stay active till either 161EV::once doesn't return anything: the watchers stay active till either
162of them triggers, then they will be stopped and freed, and the callback 162of them triggers, then they will be stopped and freed, and the callback
163invoked. 163invoked.
164 164
165=item EV::feed_fd_event ($fd, $revents)
166
167Feed an event on a file descriptor into EV. EV will react to this call as
168if the readyness notifications specified by C<$revents> (a combination of
169C<EV::READ> and C<EV::WRITE>) happened on the file descriptor C<$fd>.
170
171=item EV::feed_signal_event ($signal)
172
173Feed a signal event into EV. EV will react to this call as if the signal
174specified by C<$signal> had occured.
175
165=back 176=back
177
166 178
167=head2 WATCHER OBJECTS 179=head2 WATCHER OBJECTS
168 180
169A watcher is an object that gets created to record your interest in some 181A watcher is an object that gets created to record your interest in some
170event. For instance, if you want to wait for STDIN to become readable, you 182event. For instance, if you want to wait for STDIN to become readable, you
253The default priority of any newly-created watcher is 0. 265The default priority of any newly-created watcher is 0.
254 266
255Note that the priority semantics have not yet been fleshed out and are 267Note that the priority semantics have not yet been fleshed out and are
256subject to almost certain change. 268subject to almost certain change.
257 269
258=item $w->trigger ($revents) 270=item $w->invoke ($revents)
259 271
260Call the callback *now* with the given event mask. 272Call the callback *now* with the given event mask.
273
274=item $w->feed_event ($revents)
275
276Feed some events on this watcher into EV. EV will react to this call as if
277the watcher had received the given C<$revents> mask.
278
279=item $revents = $w->clear_pending
280
281If the watcher is pending, this function returns clears its pending status
282and returns its C<$revents> bitset (as if its callback was invoked). If the
283watcher isn't pending it does nothing and returns C<0>.
261 284
262=item $previous_state = $w->keepalive ($bool) 285=item $previous_state = $w->keepalive ($bool)
263 286
264Normally, C<EV::loop> will return when there are no active watchers 287Normally, C<EV::loop> will return when there are no active watchers
265(which is a "deadlock" because no progress can be made anymore). This is 288(which is a "deadlock" because no progress can be made anymore). This is
815our $DIED = sub { 838our $DIED = sub {
816 warn "EV: error in callback (ignoring): $@"; 839 warn "EV: error in callback (ignoring): $@";
817}; 840};
818 841
819default_loop 842default_loop
820 or die 'EV: cannot initialise libev backend. bad $ENV{LIBEV_METHODS}?'; 843 or die 'EV: cannot initialise libev backend. bad $ENV{LIBEV_FLAGS}?';
821 844
8221; 8451;
823 846
824=head1 SEE ALSO 847=head1 SEE ALSO
825 848

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines