App-watchdo

 view release on metacpan or  search on metacpan

lib/App/watchdo.pm  view on Meta::CPAN

41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
sub watch {
    my ($self) = @_;
 
    my $notify = AnyEvent::Filesys::Notify->new(
        dirs => [ $self->get_dirs ],
        cb   => sub {
            my @changed = @_;
            $self->changed([ @{ $self->changed }, @changed ]);
 
            if ( ! $self->done ) {
                $self->done( AE::timer $self->wait, 0, sub { $self->doit() } );
            }
        },
        parse_events => 1,
    );
 
    return AnyEvent::Loop::run();
}
 
sub doit {
    my ($self) = @_;



( run in 0.255 second using v1.01-cache-2.11-cpan-3cd7ad12f66 )