[Catalyst-commits] r9313 - in Catalyst-Runtime/5.80/trunk/lib/Catalyst/Engine/HTTP: . Restarter

t0m at dev.catalyst.perl.org t0m at dev.catalyst.perl.org
Sun Feb 15 05:23:07 GMT 2009


Author: t0m
Date: 2009-02-15 05:23:07 +0000 (Sun, 15 Feb 2009)
New Revision: 9313

Modified:
   Catalyst-Runtime/5.80/trunk/lib/Catalyst/Engine/HTTP/Restarter.pm
   Catalyst-Runtime/5.80/trunk/lib/Catalyst/Engine/HTTP/Restarter/Watcher.pm
Log:
Add docs, and don't bother to make components mutable if you can detect packages as they compile

Modified: Catalyst-Runtime/5.80/trunk/lib/Catalyst/Engine/HTTP/Restarter/Watcher.pm
===================================================================
--- Catalyst-Runtime/5.80/trunk/lib/Catalyst/Engine/HTTP/Restarter/Watcher.pm	2009-02-15 05:22:59 UTC (rev 9312)
+++ Catalyst-Runtime/5.80/trunk/lib/Catalyst/Engine/HTTP/Restarter/Watcher.pm	2009-02-15 05:23:07 UTC (rev 9313)
@@ -197,6 +197,17 @@
 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<B::Hooks::OP::Check::StashChange> is installed and
+can be used to detect when files are compiled. This is used internally
+to make the L<Moose> metaclass of any class being reloaded immutable.
+
+If L<B::Hooks::OP::Check::StashChange> 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<Catalyst>, L<Catalyst::Engine::HTTP::Restarter>, L<File::Modified>

Modified: Catalyst-Runtime/5.80/trunk/lib/Catalyst/Engine/HTTP/Restarter.pm
===================================================================
--- Catalyst-Runtime/5.80/trunk/lib/Catalyst/Engine/HTTP/Restarter.pm	2009-02-15 05:22:59 UTC (rev 9312)
+++ Catalyst-Runtime/5.80/trunk/lib/Catalyst/Engine/HTTP/Restarter.pm	2009-02-15 05:23:07 UTC (rev 9313)
@@ -20,7 +20,9 @@
         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 => ( 




More information about the Catalyst-commits mailing list