| Catalyst::Engine::HTTP::Restarter::Watcher - Watch for changed application |
Catalyst::Engine::HTTP::Restarter::Watcher - Watch for changed application files
my $watcher = Catalyst::Engine::HTTP::Restarter::Watcher->new(
directory => '/path/to/MyApp',
regex => '\.yml$|\.yaml$|\.conf|\.pm$',
delay => 1,
);
while (1) {
my @changed_files = $watcher->watch();
}
This class monitors a directory of files for changes made to any file matching a regular expression. It correctly handles new files added to the application as well as files that are deleted.
Creates a new Watcher object.
Returns a list of files that have been added, deleted, or changed since the last time watch was called.
Returns true if the B::Hooks::OP::Check::StashChange manpage is installed and can be used to detect when files are compiled. This is used internally to make the Moose metaclass of any class being reloaded immutable.
If the B::Hooks::OP::Check::StashChange manpage is not installed, then the restarter makes all application components immutable. This covers the simple case, but is less useful if you're using Moose in components outside Catalyst's namespaces, but inside your application directory.
Catalyst, the Catalyst::Engine::HTTP::Restarter manpage, the File::Modified manpage
Catalyst Contributors, see Catalyst.pm
Many parts are ripped out of HTTP::Server::Simple by Jesse Vincent.
This library is free software. You can redistribute it and/or modify it under the same terms as Perl itself.
| Catalyst::Engine::HTTP::Restarter::Watcher - Watch for changed application |