… | |
… | |
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 | |
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. |
|
|
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: |
131 | |
141 | |
… | |
… | |
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 |