… | |
… | |
71 | |
71 | |
72 | =cut |
72 | =cut |
73 | |
73 | |
74 | package EV; |
74 | package EV; |
75 | |
75 | |
|
|
76 | no warnings; |
76 | use strict; |
77 | use strict; |
77 | |
78 | |
78 | BEGIN { |
79 | BEGIN { |
79 | our $VERSION = '3.42'; |
80 | our $VERSION = '3.44'; |
80 | use XSLoader; |
81 | use XSLoader; |
81 | XSLoader::load "EV", $VERSION; |
82 | XSLoader::load "EV", $VERSION; |
82 | } |
83 | } |
83 | |
84 | |
84 | @EV::IO::ISA = |
85 | @EV::IO::ISA = |
… | |
… | |
129 | for more info. |
130 | for more info. |
130 | |
131 | |
131 | The loop will automatically be destroyed when it is no longer referenced |
132 | The loop will automatically be destroyed when it is no longer referenced |
132 | by any watcher and the loop object goes out of scope. |
133 | by any watcher and the loop object goes out of scope. |
133 | |
134 | |
134 | Using C<EV::FLAG_FORKCHECK> is recommended, as only the default event loop |
135 | If you are not embedding the loop, then Using C<EV::FLAG_FORKCHECK> |
135 | is protected by this module. |
136 | is recommended, as only the default event loop is protected by this |
|
|
137 | module. If you I<are> embedding this loop in the default loop, this is not |
|
|
138 | necessary, as C<EV::embed> automatically does the right thing on fork. |
136 | |
139 | |
137 | =item $loop->loop_fork |
140 | =item $loop->loop_fork |
138 | |
141 | |
139 | Must be called after a fork in the child, before entering or continuing |
142 | Must be called after a fork in the child, before entering or continuing |
140 | the event loop. An alternative is to use C<EV::FLAG_FORKCHECK> which calls |
143 | the event loop. An alternative is to use C<EV::FLAG_FORKCHECK> which calls |
… | |
… | |
975 | # use the default loop otherwise |
978 | # use the default loop otherwise |
976 | $socket_loop ||= EV::default_loop; |
979 | $socket_loop ||= EV::default_loop; |
977 | |
980 | |
978 | =over 4 |
981 | =over 4 |
979 | |
982 | |
980 | =item $w = EV::embed $otherloop, $callback |
983 | =item $w = EV::embed $otherloop[, $callback] |
981 | |
984 | |
982 | =item $w = EV::embed_ns $otherloop, $callback |
985 | =item $w = EV::embed_ns $otherloop[, $callback] |
983 | |
986 | |
984 | =item $w = $loop->embed ($otherloop, $callback) |
987 | =item $w = $loop->embed ($otherloop[, $callback]) |
985 | |
988 | |
986 | =item $w = $loop->embed_ns ($otherloop, $callback) |
989 | =item $w = $loop->embed_ns ($otherloop[, $callback]) |
987 | |
990 | |
988 | Call the callback when the embedded event loop (C<$otherloop>) has any |
991 | Call the callback when the embedded event loop (C<$otherloop>) has any |
989 | I/O activity. The C<$callback> should alwas be specified as C<undef> in |
992 | I/O activity. The C<$callback> is optional: if it is missing, then the |
990 | this version of EV, which means the embedded event loop will be managed |
993 | embedded event loop will be managed automatically (which is recommended), |
991 | automatically. |
994 | otherwise you have to invoke C<sweep> yourself. |
992 | |
995 | |
993 | The C<embed_ns> variant doesn't start (activate) the newly created watcher. |
996 | The C<embed_ns> variant doesn't start (activate) the newly created watcher. |
994 | |
997 | |
995 | =back |
998 | =back |
996 | |
999 | |