… | |
… | |
96 | loop is protected by this module. |
96 | loop is protected by this module. |
97 | |
97 | |
98 | $loop->loop_fork |
98 | $loop->loop_fork |
99 | Must be called after a fork in the child, before entering or |
99 | Must be called after a fork in the child, before entering or |
100 | continuing the event loop. An alternative is to use |
100 | continuing the event loop. An alternative is to use |
101 | "EV::FLAG_FORKCHECK" which calls this fucntion automatically, at |
101 | "EV::FLAG_FORKCHECK" which calls this function automatically, at |
102 | some performance loss (refer to the libev documentation). |
102 | some performance loss (refer to the libev documentation). |
103 | |
103 | |
|
|
104 | $loop->loop_verify |
|
|
105 | Calls "ev_verify" to make internal consistency checks (for debugging |
|
|
106 | libev) and abort the program if any data structures wree found to be |
|
|
107 | corrupted. |
|
|
108 | |
104 | $loop = EV::default_loop [$flags] |
109 | $loop = EV::default_loop [$flags] |
105 | Return the default loop (which is a singleton object). |
110 | Return the default loop (which is a singleton object). Since this |
|
|
111 | module already creates the default loop with default flags, |
|
|
112 | specifying flags here will not have any effect unless you destroy |
|
|
113 | the default loop. |
106 | |
114 | |
107 | BASIC INTERFACE |
115 | BASIC INTERFACE |
108 | $EV::DIED |
116 | $EV::DIED |
109 | Must contain a reference to a function that is called when a |
117 | Must contain a reference to a function that is called when a |
110 | callback throws an exception (with $@ containing the error). The |
118 | callback throws an exception (with $@ containing the error). The |
… | |
… | |
456 | each time the periodic watcher gets scheduled, the reschedule |
464 | each time the periodic watcher gets scheduled, the reschedule |
457 | callback ($reschedule_cb) will be called with the watcher as |
465 | callback ($reschedule_cb) will be called with the watcher as |
458 | first, and the current time as second argument. |
466 | first, and the current time as second argument. |
459 | |
467 | |
460 | *This callback MUST NOT stop or destroy this or any other |
468 | *This callback MUST NOT stop or destroy this or any other |
|
|
469 | periodic watcher, ever, and MUST NOT call any event loop |
461 | periodic watcher, ever*. If you need to stop it, return 1e30 and |
470 | functions or methods*. If you need to stop it, return 1e30 and |
462 | stop it afterwards. |
471 | stop it afterwards. You may create and start a "EV::prepare" |
|
|
472 | watcher for this task. |
463 | |
473 | |
464 | It must return the next time to trigger, based on the passed |
474 | It must return the next time to trigger, based on the passed |
465 | time value (that is, the lowest time value larger than to the |
475 | time value (that is, the lowest time value larger than or equal |
466 | second argument). It will usually be called just before the |
476 | to to the second argument). It will usually be called just |
467 | callback will be triggered, but might be called at other times, |
477 | before the callback will be triggered, but might be called at |
468 | too. |
478 | other times, too. |
469 | |
479 | |
470 | This can be used to create very complex timers, such as a timer |
480 | This can be used to create very complex timers, such as a timer |
471 | that triggers on each midnight, local time (actually 24 hours |
481 | that triggers on each midnight, local time (actually 24 hours |
472 | after the last midnight, to keep the example simple. If you know |
482 | after the last midnight, to keep the example simple. If you know |
473 | a way to do it correctly in about the same space (without |
483 | a way to do it correctly in about the same space (without |