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

Comparing EV/README (file contents):
Revision 1.16 by root, Fri Dec 7 18:11:23 2007 UTC vs.
Revision 1.19 by root, Tue Dec 18 01:37:46 2007 UTC

62 about in any case because it has much more detailed information. 62 about in any case because it has much more detailed information.
63 63
64BASIC INTERFACE 64BASIC INTERFACE
65 $EV::DIED 65 $EV::DIED
66 Must contain a reference to a function that is called when a 66 Must contain a reference to a function that is called when a
67 callback throws an exception (with $@ containing thr error). The 67 callback throws an exception (with $@ containing the error). The
68 default prints an informative message and continues. 68 default prints an informative message and continues.
69 69
70 If this callback throws an exception it will be silently ignored. 70 If this callback throws an exception it will be silently ignored.
71 71
72 $time = EV::time 72 $time = EV::time
121 "EV::READ", "EV::WRITE" and "EV::TIMEOUT"). 121 "EV::READ", "EV::WRITE" and "EV::TIMEOUT").
122 122
123 EV::once doesn't return anything: the watchers stay active till 123 EV::once doesn't return anything: the watchers stay active till
124 either of them triggers, then they will be stopped and freed, and 124 either of them triggers, then they will be stopped and freed, and
125 the callback invoked. 125 the callback invoked.
126
127 EV::feed_fd_event ($fd, $revents)
128 Feed an event on a file descriptor into EV. EV will react to this
129 call as if the readyness notifications specified by $revents (a
130 combination of "EV::READ" and "EV::WRITE") happened on the file
131 descriptor $fd.
132
133 EV::feed_signal_event ($signal)
134 Feed a signal event into EV. EV will react to this call as if the
135 signal specified by $signal had occured.
126 136
127 WATCHER OBJECTS 137 WATCHER OBJECTS
128 A watcher is an object that gets created to record your interest in some 138 A watcher is an object that gets created to record your interest in some
129 event. For instance, if you want to wait for STDIN to become readable, 139 event. For instance, if you want to wait for STDIN to become readable,
130 you would create an EV::io watcher for that: 140 you would create an EV::io watcher for that:
202 The default priority of any newly-created watcher is 0. 212 The default priority of any newly-created watcher is 0.
203 213
204 Note that the priority semantics have not yet been fleshed out and 214 Note that the priority semantics have not yet been fleshed out and
205 are subject to almost certain change. 215 are subject to almost certain change.
206 216
207 $w->trigger ($revents) 217 $w->invoke ($revents)
208 Call the callback *now* with the given event mask. 218 Call the callback *now* with the given event mask.
219
220 $w->feed_event ($revents)
221 Feed some events on this watcher into EV. EV will react to this call
222 as if the watcher had received the given $revents mask.
223
224 $revents = $w->clear_pending
225 If the watcher is pending, this function returns clears its pending
226 status and returns its $revents bitset (as if its callback was
227 invoked). If the watcher isn't pending it does nothing and returns
228 0.
209 229
210 $previous_state = $w->keepalive ($bool) 230 $previous_state = $w->keepalive ($bool)
211 Normally, "EV::loop" will return when there are no active watchers 231 Normally, "EV::loop" will return when there are no active watchers
212 (which is a "deadlock" because no progress can be made anymore). 232 (which is a "deadlock" because no progress can be made anymore).
213 This is convinient because it allows you to start your watchers (and 233 This is convinient because it allows you to start your watchers (and
389 be called at any time. 409 be called at any time.
390 410
391 $w->again 411 $w->again
392 Simply stops and starts the watcher again. 412 Simply stops and starts the watcher again.
393 413
414 $time = $w->at
415 Return the time that the watcher is expected to trigger next.
416
394 SIGNAL WATCHERS - signal me when a signal gets signalled! 417 SIGNAL WATCHERS - signal me when a signal gets signalled!
395 $w = EV::signal $signal, $callback 418 $w = EV::signal $signal, $callback
396 $w = EV::signal_ns $signal, $callback 419 $w = EV::signal_ns $signal, $callback
397 Call the callback when $signal is received (the signal can be 420 Call the callback when $signal is received (the signal can be
398 specified by number or by name, just as with "kill" or %SIG). 421 specified by number or by name, just as with "kill" or %SIG).

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines