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

Comparing EV/EV.pm (file contents):
Revision 1.55 by root, Tue Nov 27 08:11:52 2007 UTC vs.
Revision 1.56 by root, Tue Nov 27 10:59:10 2007 UTC

76 76
77@EV::IO::ISA = 77@EV::IO::ISA =
78@EV::Timer::ISA = 78@EV::Timer::ISA =
79@EV::Periodic::ISA = 79@EV::Periodic::ISA =
80@EV::Signal::ISA = 80@EV::Signal::ISA =
81@EV::Child::ISA =
82@EV::Stat::ISA =
81@EV::Idle::ISA = 83@EV::Idle::ISA =
82@EV::Prepare::ISA = 84@EV::Prepare::ISA =
83@EV::Check::ISA = 85@EV::Check::ISA =
84@EV::Child::ISA =
85@EV::Embed::ISA = 86@EV::Embed::ISA =
86@EV::Stat::ISA = "EV::Watcher"; 87@EV::Fork::ISA =
88 "EV::Watcher";
87 89
88=head1 BASIC INTERFACE 90=head1 BASIC INTERFACE
89 91
90=over 4 92=over 4
91 93
551watcher for all pids). 553watcher for all pids).
552 554
553=back 555=back
554 556
555 557
558=head3 STAT WATCHERS - did the file attributes just change?
559
560=over 4
561
562=item $w = EV::stat $path, $interval, $callback
563
564=item $w = EV::stat_ns $path, $interval, $callback
565
566Call the callback when a file status change has been detected on
567C<$path>. The C<$path> does not need to exist, changing from "path exists"
568to "path does not exist" is a status change like any other.
569
570The C<$interval> is a recommended polling interval for systems where
571OS-supported change notifications don't exist or are not supported. If
572you use C<0> then an unspecified default is used (which is highly
573recommended!), which is to be expected to be around five seconds usually.
574
575This watcher type is not meant for massive numbers of stat watchers,
576as even with OS-supported change notifications, this can be
577resource-intensive.
578
579The C<stat_ns> variant doesn't start (activate) the newly created watcher.
580
581=item $w->set ($path, $interval)
582
583Reconfigures the watcher, see the constructor above for details. Can be
584called at any time.
585
586=item $current_path = $w->path
587
588=item $old_path = $w->path ($new_path)
589
590Returns the previously set path and optionally set a new one.
591
592=item $current_interval = $w->interval
593
594=item $old_interval = $w->interval ($new_interval)
595
596Returns the previously set interval and optionally set a new one. Can be
597used to query the actual interval used.
598
599=back
600
601
556=head3 IDLE WATCHERS - when you've got nothing better to do... 602=head3 IDLE WATCHERS - when you've got nothing better to do...
557 603
558=over 4 604=over 4
559 605
560=item $w = EV::idle $callback 606=item $w = EV::idle $callback
646 692
647The C<check_ns> variant doesn't start (activate) the newly created watcher. 693The C<check_ns> variant doesn't start (activate) the newly created watcher.
648 694
649=back 695=back
650 696
651=head3 STAT WATCHERS - did the file attributes just change?
652 697
653=over 4 698=head3 FORK WATCHERS - the audacity to resume the event loop after a fork
654 699
655=item $w = EV::stat $path, $interval, $callback 700Fork watchers are called when a C<fork ()> was detected. The invocation
701is done before the event loop blocks next and before C<check> watchers
702are being called, and only in the child after the fork.
656 703
657=item $w = EV::stat_ns $path, $interval, $callback 704=over 4
658 705
659Call the callback when a file status change has been detected on 706=item $w = EV::fork $callback
660C<$path>. The C<$path> does not need to exist, changing from "path exists"
661to "path does not exist" is a status change like any other.
662 707
663The C<$interval> is a recommended polling interval for systems where 708=item $w = EV::fork_ns $callback
664OS-supported change notifications don't exist or are not supported. If
665you use C<0> then an unspecified default is used (which is highly
666recommended!), which is to be expected to be around five seconds usually.
667 709
668This watcher type is not meant for massive numbers of stat watchers, 710Call the callback before the event loop is resumed in the child process
669as even with OS-supported change notifications, this can be 711after a fork.
670resource-intensive.
671 712
672The C<stat_ns> variant doesn't start (activate) the newly created watcher. 713The C<fork_ns> variant doesn't start (activate) the newly created watcher.
673
674=item $w->set ($path, $interval)
675
676Reconfigures the watcher, see the constructor above for details. Can be
677called at any time.
678
679=item $current_path = $w->path
680
681=item $old_path = $w->path ($new_path)
682
683Returns the previously set path and optionally set a new one.
684
685=item $current_interval = $w->interval
686
687=item $old_interval = $w->interval ($new_interval)
688
689Returns the previously set interval and optionally set a new one. Can be
690used to query the actual interval used.
691 714
692=back 715=back
693 716
694 717
695=head1 THREADS 718=head1 THREADS

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines