1 package Catalyst::Restarter::Forking;
5 extends 'Catalyst::Restarter';
16 if ( my $pid = fork ) {
20 # Only the parent process needs to watch for changes, so the child
21 # should release any resources held by the watcher:
22 $self->_clear_watcher;
30 return unless $self->_child;
32 return unless kill 0, $self->_child;
34 die "Cannot send INT signal to ", $self->_child, ": $!"
35 unless kill 'INT', $self->_child;
36 # If we don't wait for the child to exit, we could attempt to
37 # start a new server before the old one has given up the port it
42 __PACKAGE__->meta->make_immutable;
50 Catalyst::Restarter::Forking - Forks and restarts the child process
54 This class forks and runs the server in a child process. When it needs
55 to restart, it kills the child and creates a new one.
59 L<Catalyst::Restarter>, L<Catalyst>, <File::ChangeNotify>
63 Catalyst Contributors, see Catalyst.pm
67 This program is free software, you can redistribute it and/or modify
68 it under the same terms as Perl itself.