[Catalyst-commits] r13974 - CatalystX-Restarter-GTK/trunk/lib/CatalystX/Restarter

dd070 at dev.catalyst.perl.org dd070 at dev.catalyst.perl.org
Thu Feb 17 06:40:33 GMT 2011


Author: dd070
Date: 2011-02-17 06:40:33 +0000 (Thu, 17 Feb 2011)
New Revision: 13974

Modified:
   CatalystX-Restarter-GTK/trunk/lib/CatalystX/Restarter/GTK.pm
Log:
renamed run to run_and_watch to be called from Server

Modified: CatalystX-Restarter-GTK/trunk/lib/CatalystX/Restarter/GTK.pm
===================================================================
--- CatalystX-Restarter-GTK/trunk/lib/CatalystX/Restarter/GTK.pm	2011-02-16 16:24:57 UTC (rev 13973)
+++ CatalystX-Restarter-GTK/trunk/lib/CatalystX/Restarter/GTK.pm	2011-02-17 06:40:33 UTC (rev 13974)
@@ -55,9 +55,14 @@
     is => 'rw'
 );
 
-sub run {
-    my ($self, $auto_restart) = @_;
+has auto_restart => (
+    is => 'rw',
+    default => 1
+);
 
+sub run_and_watch {
+    my ($self) = @_;
+
     my $sem = IPC::Semaphore->new(IPC_PRIVATE, 1, S_IRWXU | IPC_CREAT)
         or croak "Can not create semaphore $!";
 
@@ -107,7 +112,7 @@
             }
         );
 
-        if ($auto_restart) {
+        if ($self->auto_restart) {
             my $timer = AnyEvent->timer(
                 after       => 1,
                 interval    => 1,
@@ -267,11 +272,8 @@
         STDOUT->autoflush(1);
 
         try {
-
             $self->start_sub->();
-
         }
-
         catch {
 
             STDERR->print($_);
@@ -452,10 +454,6 @@
 
 =head1 DESCRIPTION
 
-This module works with CatalystX::Script::Server::GTK and CatalystX::Restarter::GTK.
-
-CatalystX::Restarter::GTK selects this module as a Restarter. It instantiates this module with restarter arguments and calls run to pass control and wither to auto restart upon file changes.
-
 It shows a small GUI window for controlling catalyst server and notifying status. It also captures console output printed by application at run time, both STDERR and STDOUT.
 
 This module forks two processes. First child process creates GUI window and listens for incoming messages from parent.(console output and signals for notifying status change). Second child process runs the actual server and creates server socket by calling run() on application module.




More information about the Catalyst-commits mailing list