Skip to content

Instantly share code, notes, and snippets.

@Maffsie
Created February 14, 2015 02:24
Show Gist options
  • Save Maffsie/f00b19df557981c78b74 to your computer and use it in GitHub Desktop.
Save Maffsie/f00b19df557981c78b74 to your computer and use it in GitHub Desktop.
POE::Session->create( inline_states => { _start => sub {
foreach my $monitor (keys $Conf->{monitor}) {
$_[HEAP]->{$monitor} = POE::Component::DirWatch->new(
alias => $monitor,
directory => $Conf->{monitor}->{$monitor}->{dir},
filter => sub { filter($monitor,$_);},
file_callback => sub { trigger($monitor,$_);},
interval => $Conf->{monitor}->{$monitor}->{poll},
);
}
}});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment