… | |
… | |
1236 | watcher isn't pending it does nothing and returns C<0>. |
1236 | watcher isn't pending it does nothing and returns C<0>. |
1237 | |
1237 | |
1238 | Sometimes it can be useful to "poll" a watcher instead of waiting for its |
1238 | Sometimes it can be useful to "poll" a watcher instead of waiting for its |
1239 | callback to be invoked, which can be accomplished with this function. |
1239 | callback to be invoked, which can be accomplished with this function. |
1240 | |
1240 | |
|
|
1241 | =item ev_feed_event (struct ev_loop *, watcher *, int revents) |
|
|
1242 | |
|
|
1243 | Feeds the given event set into the event loop, as if the specified event |
|
|
1244 | had happened for the specified watcher (which must be a pointer to an |
|
|
1245 | initialised but not necessarily started event watcher). Obviously you must |
|
|
1246 | not free the watcher as long as it has pending events. |
|
|
1247 | |
|
|
1248 | Stopping the watcher, letting libev invoke it, or calling |
|
|
1249 | C<ev_clear_pending> will clear the pending event, even if the watcher was |
|
|
1250 | not started in the first place. |
|
|
1251 | |
|
|
1252 | See also C<ev_feed_fd_event> and C<ev_feed_signal_event> for related |
|
|
1253 | functions that do not need a watcher. |
|
|
1254 | |
1241 | =back |
1255 | =back |
1242 | |
1256 | |
1243 | |
1257 | |
1244 | =head2 ASSOCIATING CUSTOM DATA WITH A WATCHER |
1258 | =head2 ASSOCIATING CUSTOM DATA WITH A WATCHER |
1245 | |
1259 | |
… | |
… | |
3135 | /* doh, nothing entered */; |
3149 | /* doh, nothing entered */; |
3136 | } |
3150 | } |
3137 | |
3151 | |
3138 | ev_once (STDIN_FILENO, EV_READ, 10., stdin_ready, 0); |
3152 | ev_once (STDIN_FILENO, EV_READ, 10., stdin_ready, 0); |
3139 | |
3153 | |
3140 | =item ev_feed_event (struct ev_loop *, watcher *, int revents) |
|
|
3141 | |
|
|
3142 | Feeds the given event set into the event loop, as if the specified event |
|
|
3143 | had happened for the specified watcher (which must be a pointer to an |
|
|
3144 | initialised but not necessarily started event watcher). |
|
|
3145 | |
|
|
3146 | =item ev_feed_fd_event (struct ev_loop *, int fd, int revents) |
3154 | =item ev_feed_fd_event (struct ev_loop *, int fd, int revents) |
3147 | |
3155 | |
3148 | Feed an event on the given fd, as if a file descriptor backend detected |
3156 | Feed an event on the given fd, as if a file descriptor backend detected |
3149 | the given events it. |
3157 | the given events it. |
3150 | |
3158 | |