… | |
… | |
68 | package EV; |
68 | package EV; |
69 | |
69 | |
70 | use strict; |
70 | use strict; |
71 | |
71 | |
72 | BEGIN { |
72 | BEGIN { |
73 | our $VERSION = '1.71'; |
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 | |
97 | Must contain a reference to a function that is called when a callback |
97 | Must contain a reference to a function that is called when a callback |
98 | throws an exception (with $@ containing thr error). The default prints an |
98 | throws an exception (with $@ containing the error). The default prints an |
99 | informative message and continues. |
99 | informative message and continues. |
100 | |
100 | |
101 | If this callback throws an exception it will be silently ignored. |
101 | If this callback throws an exception it will be silently ignored. |
102 | |
102 | |
103 | =item $time = EV::time |
103 | =item $time = EV::time |
… | |
… | |
160 | |
160 | |
161 | EV::once doesn't return anything: the watchers stay active till either |
161 | EV::once doesn't return anything: the watchers stay active till either |
162 | of them triggers, then they will be stopped and freed, and the callback |
162 | of them triggers, then they will be stopped and freed, and the callback |
163 | invoked. |
163 | invoked. |
164 | |
164 | |
|
|
165 | =item EV::feed_fd_event ($fd, $revents) |
|
|
166 | |
|
|
167 | Feed an event on a file descriptor into EV. EV will react to this call as |
|
|
168 | if the readyness notifications specified by C<$revents> (a combination of |
|
|
169 | C<EV::READ> and C<EV::WRITE>) happened on the file descriptor C<$fd>. |
|
|
170 | |
|
|
171 | =item EV::feed_signal_event ($signal) |
|
|
172 | |
|
|
173 | Feed a signal event into EV. EV will react to this call as if the signal |
|
|
174 | specified by C<$signal> had occured. |
|
|
175 | |
165 | =back |
176 | =back |
|
|
177 | |
166 | |
178 | |
167 | =head2 WATCHER OBJECTS |
179 | =head2 WATCHER OBJECTS |
168 | |
180 | |
169 | A watcher is an object that gets created to record your interest in some |
181 | A watcher is an object that gets created to record your interest in some |
170 | event. For instance, if you want to wait for STDIN to become readable, you |
182 | event. For instance, if you want to wait for STDIN to become readable, you |
… | |
… | |
253 | The default priority of any newly-created watcher is 0. |
265 | The default priority of any newly-created watcher is 0. |
254 | |
266 | |
255 | Note that the priority semantics have not yet been fleshed out and are |
267 | Note that the priority semantics have not yet been fleshed out and are |
256 | subject to almost certain change. |
268 | subject to almost certain change. |
257 | |
269 | |
258 | =item $w->trigger ($revents) |
270 | =item $w->invoke ($revents) |
259 | |
271 | |
260 | Call the callback *now* with the given event mask. |
272 | Call the callback *now* with the given event mask. |
|
|
273 | |
|
|
274 | =item $w->feed_event ($revents) |
|
|
275 | |
|
|
276 | Feed some events on this watcher into EV. EV will react to this call as if |
|
|
277 | the watcher had received the given C<$revents> mask. |
|
|
278 | |
|
|
279 | =item $revents = $w->clear_pending |
|
|
280 | |
|
|
281 | If the watcher is pending, this function returns clears its pending status |
|
|
282 | and returns its C<$revents> bitset (as if its callback was invoked). If the |
|
|
283 | watcher 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 | |
264 | Normally, C<EV::loop> will return when there are no active watchers |
287 | Normally, 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 |