… | |
… | |
55 | package EV; |
55 | package EV; |
56 | |
56 | |
57 | use strict; |
57 | use strict; |
58 | |
58 | |
59 | BEGIN { |
59 | BEGIN { |
60 | our $VERSION = '0.01'; |
60 | our $VERSION = '0.02'; |
61 | use XSLoader; |
61 | use XSLoader; |
62 | XSLoader::load "EV", $VERSION; |
62 | XSLoader::load "EV", $VERSION; |
63 | } |
63 | } |
64 | |
64 | |
65 | =head1 FUNCTIONAL INTERFACE |
65 | =head1 BASIC INTERFACE |
66 | |
66 | |
67 | =over 4 |
67 | =over 4 |
68 | |
68 | |
69 | =item $EV::NPRI |
69 | =item $EV::NPRI |
70 | |
70 | |
71 | How many priority levels are available. |
71 | How many priority levels are available. |
|
|
72 | |
|
|
73 | =item $EV::DIED |
|
|
74 | |
|
|
75 | Must contain a reference to a function that is called when a callback |
|
|
76 | throws an exception (with $@ containing thr error). The default prints an |
|
|
77 | informative message and continues. |
|
|
78 | |
|
|
79 | If this callback throws an exception it will be silently ignored. |
72 | |
80 | |
73 | =item $time = EV::now |
81 | =item $time = EV::now |
74 | |
82 | |
75 | Returns the time in (fractional) seconds since the epoch. |
83 | Returns the time in (fractional) seconds since the epoch. |
76 | |
84 | |
… | |
… | |
231 | In general, if you fork, then you can only use the EV module in one of the |
239 | In general, if you fork, then you can only use the EV module in one of the |
232 | children. |
240 | children. |
233 | |
241 | |
234 | =cut |
242 | =cut |
235 | |
243 | |
|
|
244 | our $DIED = sub { |
|
|
245 | warn "EV: error in callback (ignoring): $@"; |
|
|
246 | }; |
|
|
247 | |
236 | our $NPRI = 4; |
248 | our $NPRI = 4; |
237 | our $BASE = init; |
249 | our $BASE = init; |
238 | priority_init $NPRI; |
250 | priority_init $NPRI; |
239 | |
251 | |
240 | push @AnyEvent::REGISTRY, [EV => "EV::AnyEvent"]; |
252 | push @AnyEvent::REGISTRY, [EV => "EV::AnyEvent"]; |