… | |
… | |
111 | default loop as this is fastest (perl-wise), best supported by other |
111 | default loop as this is fastest (perl-wise), best supported by other |
112 | modules (e.g. AnyEvent or Coro) and most portable event loop. |
112 | modules (e.g. AnyEvent or Coro) and most portable event loop. |
113 | |
113 | |
114 | For specific programs you can create additional event loops dynamically. |
114 | For specific programs you can create additional event loops dynamically. |
115 | |
115 | |
|
|
116 | If you want to take avdantage of kqueue (which often works properly for |
|
|
117 | sockets only) even though the default loop doesn't enable it, you can |
|
|
118 | I<embed> a kqueue loop into the default loop: running the default loop |
|
|
119 | will then also service the kqueue loop to some extent. See the example in |
|
|
120 | the section about embed watchers for an example on how to achieve that. |
|
|
121 | |
116 | =over 4 |
122 | =over 4 |
117 | |
123 | |
118 | =item $loop = new EV::loop [$flags] |
124 | =item $loop = new EV::loop [$flags] |
119 | |
125 | |
120 | Create a new event loop as per the specified flags. Please refer to the |
126 | Create a new event loop as per the specified flags. Please refer to the |
… | |
… | |
136 | documentation). |
142 | documentation). |
137 | |
143 | |
138 | =item $loop->loop_verify |
144 | =item $loop->loop_verify |
139 | |
145 | |
140 | Calls C<ev_verify> to make internal consistency checks (for debugging |
146 | Calls C<ev_verify> to make internal consistency checks (for debugging |
141 | libev) and abort the program if any data structures wree found to be |
147 | libev) and abort the program if any data structures were found to be |
142 | corrupted. |
148 | corrupted. |
143 | |
149 | |
144 | =item $loop = EV::default_loop [$flags] |
150 | =item $loop = EV::default_loop [$flags] |
145 | |
151 | |
146 | Return the default loop (which is a singleton object). Since this module |
152 | Return the default loop (which is a singleton object). Since this module |
147 | already creates the default loop with default flags, specifying flags here |
153 | already creates the default loop with default flags, specifying flags here |
148 | will not have any effect unless you destroy the default loop. |
154 | will not have any effect unless you destroy the default loop first, which |
|
|
155 | isn't supported. So in short: don't do it, and if you break it, you get to |
|
|
156 | keep the pieces. |
149 | |
157 | |
150 | =back |
158 | =back |
151 | |
159 | |
152 | |
160 | |
153 | =head1 BASIC INTERFACE |
161 | =head1 BASIC INTERFACE |