which was just a copy of the parent's method.
=head1 SYNOPSIS
- my $restarter = Catalyst::Restarter->new(
+ my $class = Catalyst::Restarter->pick_subclass;
+
+ my $restarter = $class->new(
directories => '/path/to/MyApp',
regex => '\.yml$|\.yaml$|\.conf|\.pm$',
start_sub => sub { ... }
=head1 DESCRIPTION
+This is the base class for all restarters, and it also provide
+functionality for picking an appropriate restarter subclass for a
+given platform.
+
This class uses L<File::ChangeNotify> to watch one or more directories
of files and restart the Catalyst server when any of those files
changes.
=head1 METHODS
+=head2 pick_subclass
+
+Returns the name of an appropriate subclass for the given platform.
+
=head2 new ( start_sub => sub { ... }, ... )
-This method creates a new restarter object.
+This method creates a new restarter object, but should be called on a
+subclass, not this class.
The "start_sub" argument is required. This is a subroutine reference
that can be used to start the Catalyst server.
}
1;
+
+__END__
+
+=head1 NAME
+
+Catalyst::Restarter::Forking - Forks and restarts the child process
+
+=head1 DESCRIPTION
+
+This class forks and runs the server in a child process. When it needs
+to restart, it kills the child and creates a new one.
+
+=head1 SEE ALSO
+
+L<Catalyst::Restarter>, L<Catalyst>, <File::ChangeNotify>
+
+=head1 AUTHORS
+
+Catalyst Contributors, see Catalyst.pm
+
+=head1 COPYRIGHT
+
+This program is free software, you can redistribute it and/or modify
+it under the same terms as Perl itself.
+
+=cut
);
-sub run_and_watch {
- my $self = shift;
-
- $self->_fork_and_start;
-
- return unless $self->_child;
-
- $self->_restart_on_changes;
-}
-
sub _fork_and_start {
my $self = shift;
}
1;
+
+__END__
+
+=head1 NAME
+
+Catalyst::Restarter::Win32 - Uses Proc::Background to manage process restarts
+
+=head1 DESCRIPTION
+
+This class uses L<Proc::Background>, which in turn uses
+L<Win32::Process>. The new process is run using the same command-line
+as the original script, but without any restart-based options.
+
+This is a big hack, but using forks just does not work on Windows.
+
+=head1 SEE ALSO
+
+L<Catalyst::Restarter>, L<Catalyst>, <File::ChangeNotify>
+
+=head1 AUTHORS
+
+Catalyst Contributors, see Catalyst.pm
+
+=head1 COPYRIGHT
+
+This program is free software, you can redistribute it and/or modify
+it under the same terms as Perl itself.
+
+=cut