AnyEvent-Inotify-Simple

 view release on metacpan or  search on metacpan

lib/AnyEvent/Inotify/Simple.pm  view on Meta::CPAN

=head1 NAME

AnyEvent::Inotify::Simple - monitor a directory tree in a non-blocking way

=head1 SYNOPSIS

   use AnyEvent::Inotify::Simple;
   use EV; # or POE, or Event, or ...

   my $inotify = AnyEvent::Inotify::Simple->new(
       directory      => '/tmp/uploads/',
       wanted_events  => [ qw(create move) ],
       event_receiver => sub {
           my ($event, $file, $moved_to) = @_;
           given($event) {
               when('create'){
                  say "Someone just uploaded $file!"
               }
           };
       },
   );

   EV::loop;

=head1 DESCRIPTION

This module is a wrapper around L<Linux::Inotify2> that integrates it



( run in 0.615 second using v1.01-cache-2.11-cpan-b16cb0d3907 )