From: Tomas Doran Date: Sun, 15 Feb 2009 05:23:07 +0000 (+0000) Subject: Add docs, and don't bother to make components mutable if you can detect packages... X-Git-Tag: 5.80001~97 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=commitdiff_plain;h=c03163b837135f3bf3d65380e90b4a68bcc38099 Add docs, and don't bother to make components mutable if you can detect packages as they compile --- diff --git a/lib/Catalyst/Engine/HTTP/Restarter.pm b/lib/Catalyst/Engine/HTTP/Restarter.pm index 45b925a..0fffaf0 100644 --- a/lib/Catalyst/Engine/HTTP/Restarter.pm +++ b/lib/Catalyst/Engine/HTTP/Restarter.pm @@ -20,7 +20,9 @@ around run => sub { close STDIN; close STDOUT; - $self->_make_components_mutable($class); + # Best effort if we can't trap compiles.. + $self->_make_components_mutable($class) + if !Catalyst::Engine::HTTP::Restarter::Watcher::DETECT_PACKAGE_COMPILATION(); my $watcher = Catalyst::Engine::HTTP::Restarter::Watcher->new( directory => ( diff --git a/lib/Catalyst/Engine/HTTP/Restarter/Watcher.pm b/lib/Catalyst/Engine/HTTP/Restarter/Watcher.pm index 3690877..4095e83 100644 --- a/lib/Catalyst/Engine/HTTP/Restarter/Watcher.pm +++ b/lib/Catalyst/Engine/HTTP/Restarter/Watcher.pm @@ -197,6 +197,17 @@ Creates a new Watcher object. Returns a list of files that have been added, deleted, or changed since the last time watch was called. +=head2 DETECT_PACKAGE_COMPILATION + +Returns true if L is installed and +can be used to detect when files are compiled. This is used internally +to make the L metaclass of any class being reloaded immutable. + +If L 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. + =head1 SEE ALSO L, L, L