Catalyst::Restarter(3pm)

Catalyst::Restarter3pm

Uses file::changenotify to check for changed files and restart the server

Usage

    my $class = Catalyst::Restarter->pick_subclass;
    my $restarter = $class->new(
        directories => '/path/to/MyApp',
        regex       => '\.yml$|\.yaml$|\.conf|\.pm$',
        start_sub => sub { ... }
    );
    $restarter->run_and_watch;

Overview

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 File::ChangeNotify to watch one or more directories of files and restart the Catalyst server when any of those files changes.

Methods

pick_subclass

Returns the name of an appropriate subclass for the given platform.

new ( start_sub => sub { ... }, ... )

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.

run_and_watch

This method forks, starts the server in a child process, and then watched for changed files in the parent. When files change, it kills the child, forks again, and starts a new server.

Releases

8 releases since Debian 6.0 (Squeeze); the text changed 4 times.

  1. 6.0
  2. 7
  3. 8–9
  4. 10
  5. 11–13

Authors

Catalyst Contributors, see Catalyst.pm

From libcatalyst-devel-perl 1.42-1 in Debian 13 (Trixie). Parsed by carta from the page's man source.