… | |
… | |
41 | EV::loop EV::LOOP_ONSHOT; |
41 | EV::loop EV::LOOP_ONSHOT; |
42 | |
42 | |
43 | =head1 DESCRIPTION |
43 | =head1 DESCRIPTION |
44 | |
44 | |
45 | This module provides an interface to libevent |
45 | This module provides an interface to libevent |
46 | (L<http://monkey.org/~provos/libevent/>). |
46 | (L<http://monkey.org/~provos/libevent/>). You probably should acquaint |
|
|
47 | yourself with its documentation and source code to be able to use this |
|
|
48 | module fully. |
|
|
49 | |
|
|
50 | Please note thta this module disables the libevent EPOLL method by |
|
|
51 | default, see BUGS, below, if you need to enable it. |
47 | |
52 | |
48 | =cut |
53 | =cut |
49 | |
54 | |
50 | package EV; |
55 | package EV; |
51 | |
56 | |
… | |
… | |
204 | =head1 BUGS |
209 | =head1 BUGS |
205 | |
210 | |
206 | Lots. Libevent itself isn't well tested and rather buggy, and this module |
211 | Lots. Libevent itself isn't well tested and rather buggy, and this module |
207 | is quite new at the moment. |
212 | is quite new at the moment. |
208 | |
213 | |
|
|
214 | Please note that the epoll method is not, in general, reliable in |
|
|
215 | programs that use fork (even if no libveent calls are being made in the |
|
|
216 | forked process). Since this is such a common issue, this module will |
|
|
217 | force the epoll method in EV to be off *unless* the global variable |
|
|
218 | $EV::ENABLE_EPOLL is set to 1 *before* loading this module for the first |
|
|
219 | time. |
|
|
220 | |
209 | =cut |
221 | =cut |
210 | |
222 | |
211 | our $NPRI = 4; |
223 | our $NPRI = 4; |
|
|
224 | our $BASE; |
|
|
225 | our $ENABLE_EPOLL; |
|
|
226 | |
|
|
227 | { |
|
|
228 | local $ENV{EVENT_NOEPOLL}; |
|
|
229 | $ENV{EVENT_NOEPOLL} = 1 unless $ENABLE_EPOLL; |
212 | our $BASE = init; |
230 | $BASE = init; |
|
|
231 | } |
|
|
232 | |
213 | priority_init $NPRI; |
233 | priority_init $NPRI; |
214 | |
234 | |
|
|
235 | push @AnyEvent::REGISTRY, [EV => "EV::AnyEvent"]; |
|
|
236 | |
215 | 1; |
237 | 1; |
216 | |
238 | |
217 | =head1 SEE ALSO |
239 | =head1 SEE ALSO |
218 | |
240 | |
219 | L<EV::DNS>, L<event(3)>, L<event.h>, L<evdns.h>. |
241 | L<EV::DNS>, L<event(3)>, L<event.h>, L<evdns.h>. |
|
|
242 | L<EV::AnyEvent>. |
220 | |
243 | |
221 | =head1 AUTHOR |
244 | =head1 AUTHOR |
222 | |
245 | |
223 | Marc Lehmann <schmorp@schmorp.de> |
246 | Marc Lehmann <schmorp@schmorp.de> |
224 | http://home.schmorp.de/ |
247 | http://home.schmorp.de/ |