ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/EV/EV.pm
(Generate patch)

Comparing EV/EV.pm (file contents):
Revision 1.21 by root, Thu Nov 1 17:20:25 2007 UTC vs.
Revision 1.24 by root, Fri Nov 2 22:03:00 2007 UTC

150In the rare case where one wants to create a watcher but not start it at 150In the rare case where one wants to create a watcher but not start it at
151the same time, each constructor has a variant with a trailing C<_ns> in 151the same time, each constructor has a variant with a trailing C<_ns> in
152its name, e.g. EV::io has a non-starting variant EV::io_ns and so on. 152its name, e.g. EV::io has a non-starting variant EV::io_ns and so on.
153 153
154Please note that a watcher will automatically be stopped when the watcher 154Please note that a watcher will automatically be stopped when the watcher
155object is returned, so you I<need> to keep the watcher objects returned by 155object is destroyed, so you I<need> to keep the watcher objects returned by
156the constructors. 156the constructors.
157
158Also, all methods changing some aspect of a watcher (->set, ->priority,
159->fh and so on) automatically stop and start it again if it is active,
160which means pending events get lost.
157 161
158=head2 WATCHER TYPES 162=head2 WATCHER TYPES
159 163
160Now lets move to the existing watcher types and asociated methods. 164Now lets move to the existing watcher types and asociated methods.
161 165
184 188
185=item $current_cb = $w->cb 189=item $current_cb = $w->cb
186 190
187=item $old_cb = $w->cb ($new_cb) 191=item $old_cb = $w->cb ($new_cb)
188 192
189Queries the callback on the watcher and optionally changes it. You cna do 193Queries the callback on the watcher and optionally changes it. You can do
190this at any time. 194this at any time without the watcher restarting.
195
196=item $current_priority = $w->priority
197
198=item $old_priority = $w->priority ($new_priority)
199
200Queries the priority on the watcher and optionally changes it. Pending
201watchers with higher priority will be invoked first. The valid range of
202priorities lies between EV::MAXPRI (default 2) and EV::MINPRI (default
203-2). If the priority is outside this range it will automatically be
204normalised to the nearest valid priority.
205
206The default priority of any newly-created weatcher is 0.
191 207
192=item $w->trigger ($revents) 208=item $w->trigger ($revents)
193 209
194Call the callback *now* with the given event mask. 210Call the callback *now* with the given event mask.
195 211
323=item $w->set ($signal) 339=item $w->set ($signal)
324 340
325Reconfigures the watcher, see the constructor above for details. Can be at 341Reconfigures the watcher, see the constructor above for details. Can be at
326any time. 342any time.
327 343
344=item $current_signum = $w->signal
345
346=item $old_signum = $w->signal ($new_signal)
347
348Returns the previously set signal (always as a number not name) and
349optionally set a new one.
350
328 351
329=item $w = EV::child $pid, $callback 352=item $w = EV::child $pid, $callback
330 353
331=item $w = EV::child_ns $pid, $callback 354=item $w = EV::child_ns $pid, $callback
332 355
345 368
346=item $w->set ($pid) 369=item $w->set ($pid)
347 370
348Reconfigures the watcher, see the constructor above for details. Can be at 371Reconfigures the watcher, see the constructor above for details. Can be at
349any time. 372any time.
373
374=item $current_pid = $w->pid
375
376=item $old_pid = $w->pid ($new_pid)
377
378Returns the previously set process id and optionally set a new one.
350 379
351 380
352=item $w = EV::idle $callback 381=item $w = EV::idle $callback
353 382
354=item $w = EV::idle_ns $callback 383=item $w = EV::idle_ns $callback

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines