… | |
… | |
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 | |
… | |
… | |
551 | watcher for all pids). |
553 | watcher 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 | |
|
|
566 | Call the callback when a file status change has been detected on |
|
|
567 | C<$path>. The C<$path> does not need to exist, changing from "path exists" |
|
|
568 | to "path does not exist" is a status change like any other. |
|
|
569 | |
|
|
570 | The C<$interval> is a recommended polling interval for systems where |
|
|
571 | OS-supported change notifications don't exist or are not supported. If |
|
|
572 | you use C<0> then an unspecified default is used (which is highly |
|
|
573 | recommended!), which is to be expected to be around five seconds usually. |
|
|
574 | |
|
|
575 | This watcher type is not meant for massive numbers of stat watchers, |
|
|
576 | as even with OS-supported change notifications, this can be |
|
|
577 | resource-intensive. |
|
|
578 | |
|
|
579 | The C<stat_ns> variant doesn't start (activate) the newly created watcher. |
|
|
580 | |
|
|
581 | =item $w->set ($path, $interval) |
|
|
582 | |
|
|
583 | Reconfigures the watcher, see the constructor above for details. Can be |
|
|
584 | called at any time. |
|
|
585 | |
|
|
586 | =item $current_path = $w->path |
|
|
587 | |
|
|
588 | =item $old_path = $w->path ($new_path) |
|
|
589 | |
|
|
590 | Returns 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 | |
|
|
596 | Returns the previously set interval and optionally set a new one. Can be |
|
|
597 | used 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 | |
647 | The C<check_ns> variant doesn't start (activate) the newly created watcher. |
693 | The 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 |
700 | Fork watchers are called when a C<fork ()> was detected. The invocation |
|
|
701 | is done before the event loop blocks next and before C<check> watchers |
|
|
702 | are 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 | |
659 | Call the callback when a file status change has been detected on |
706 | =item $w = EV::fork $callback |
660 | C<$path>. The C<$path> does not need to exist, changing from "path exists" |
|
|
661 | to "path does not exist" is a status change like any other. |
|
|
662 | |
707 | |
663 | The C<$interval> is a recommended polling interval for systems where |
708 | =item $w = EV::fork_ns $callback |
664 | OS-supported change notifications don't exist or are not supported. If |
|
|
665 | you use C<0> then an unspecified default is used (which is highly |
|
|
666 | recommended!), which is to be expected to be around five seconds usually. |
|
|
667 | |
709 | |
668 | This watcher type is not meant for massive numbers of stat watchers, |
710 | Call the callback before the event loop is resumed in the child process |
669 | as even with OS-supported change notifications, this can be |
711 | after a fork. |
670 | resource-intensive. |
|
|
671 | |
712 | |
672 | The C<stat_ns> variant doesn't start (activate) the newly created watcher. |
713 | The C<fork_ns> variant doesn't start (activate) the newly created watcher. |
673 | |
|
|
674 | =item $w->set ($path, $interval) |
|
|
675 | |
|
|
676 | Reconfigures the watcher, see the constructor above for details. Can be |
|
|
677 | called at any time. |
|
|
678 | |
|
|
679 | =item $current_path = $w->path |
|
|
680 | |
|
|
681 | =item $old_path = $w->path ($new_path) |
|
|
682 | |
|
|
683 | Returns 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 | |
|
|
689 | Returns the previously set interval and optionally set a new one. Can be |
|
|
690 | used to query the actual interval used. |
|
|
691 | |
714 | |
692 | =back |
715 | =back |
693 | |
716 | |
694 | |
717 | |
695 | =head1 THREADS |
718 | =head1 THREADS |