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

Comparing EV/README (file contents):
Revision 1.13 by root, Tue Nov 27 16:35:47 2007 UTC vs.
Revision 1.15 by root, Wed Dec 5 14:06:50 2007 UTC

94 When called with no arguments or an argument of EV::UNLOOP_ONE, 94 When called with no arguments or an argument of EV::UNLOOP_ONE,
95 makes the innermost call to EV::loop return. 95 makes the innermost call to EV::loop return.
96 96
97 When called with an argument of EV::UNLOOP_ALL, all calls to 97 When called with an argument of EV::UNLOOP_ALL, all calls to
98 EV::loop will return as fast as possible. 98 EV::loop will return as fast as possible.
99
100 $count = EV::loop_count
101 Return the number of times the event loop has polled for new events.
102 Sometiems useful as a generation counter.
99 103
100 EV::once $fh_or_undef, $events, $timeout, $cb->($revents) 104 EV::once $fh_or_undef, $events, $timeout, $cb->($revents)
101 This function rolls together an I/O and a timer watcher for a single 105 This function rolls together an I/O and a timer watcher for a single
102 one-shot event without the need for managing a watcher object. 106 one-shot event without the need for managing a watcher object.
103 107
468 resource-intensive. 472 resource-intensive.
469 473
470 The "stat_ns" variant doesn't start (activate) the newly created 474 The "stat_ns" variant doesn't start (activate) the newly created
471 watcher. 475 watcher.
472 476
477 ... = $w->stat
478 This call is very similar to the perl "stat" built-in: It stats
479 (using "lstat") the path specified in the watcher and sets perls
480 stat cache (as well as EV's idea of the current stat values) to the
481 values found.
482
483 In scalar context, a boolean is return indicating success or failure
484 of the stat. In list context, the same 13-value list as with stat is
485 returned (except that the blksize and blocks fields are not
486 reliable).
487
488 In the case of an error, errno is set to "ENOENT" (regardless of the
489 actual error value) and the "nlink" value is forced to zero (if the
490 stat was successful then nlink is guaranteed to be non-zero).
491
492 See also the next two entries for more info.
493
494 ... = $w->attr
495 Just like "$w->stat", but without the initial stat'ing: this returns
496 the values most recently detected by EV. See the next entry for more
497 info.
498
499 ... = $w->prev
500 Just like "$w->stat", but without the initial stat'ing: this returns
501 the previous set of values, before the change.
502
503 That is, when the watcher callback is invoked, "$w->prev" will be
504 set to the values found *before* a change was detected, while
505 "$w->attr" returns the values found leading to the change detection.
506 The difference (if any) between "prev" and "attr" is what triggered
507 the callback.
508
509 If you did something to the filesystem object and do not want to
510 trigger yet another change, you can call "stat" to update EV's idea
511 of what the current attributes are.
512
473 $w->set ($path, $interval) 513 $w->set ($path, $interval)
474 Reconfigures the watcher, see the constructor above for details. Can 514 Reconfigures the watcher, see the constructor above for details. Can
475 be called at any time. 515 be called at any time.
476 516
477 $current_path = $w->path 517 $current_path = $w->path
594 634
595 On win32, there is no notion of fork so all this doesn't apply, of 635 On win32, there is no notion of fork so all this doesn't apply, of
596 course. 636 course.
597 637
598SEE ALSO 638SEE ALSO
599 EV::DNS. 639 EV::ADNS (asynchronous dns), Glib::EV (makes Glib/Gtk2 use EV as event
640 loop), Coro::EV (efficient coroutines with EV).
600 641
601AUTHOR 642AUTHOR
602 Marc Lehmann <schmorp@schmorp.de> 643 Marc Lehmann <schmorp@schmorp.de>
603 http://home.schmorp.de/ 644 http://home.schmorp.de/
604 645

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines