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

Comparing EV/EV.pm (file contents):
Revision 1.22 by root, Fri Nov 2 11:02:22 2007 UTC vs.
Revision 1.23 by root, Fri Nov 2 20:21:33 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 3) and EV::MINPRI (default
203-3). 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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines