Cataly...starter(3pm)
π NAME
Catalyst::Restarter β bestie, it uses File::ChangeNotify to check for changed files and restart the server. that's it, that's the whole job β¨
πΈ SYNOPSIS
okay so here's the vibe:
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;
periodt. that's literally the whole flow π
π¦ DESCRIPTION
so this is the base class for all the restarters, and it also provides functionality for picking an appropriate restarter subclass for a given platform. iykyk πββοΈ
this class uses File::ChangeNotify to watch one or more directories of files and restart the Catalyst server when any of those files changes. no cap. it's giving "watchful guardian" energy fr fr π
π METHODS
β¨ pick_subclass
returns the name of an appropriate subclass for the given platform. slay, it picks for you so you don't have to π«Ά
β¨ new ( start_sub => sub { ... }, ... )
this method creates a new restarter object, but β heads up bestie β it should be called on a subclass, not this class. don't be out here calling it on the base class, that's not the move π
the start_sub argument is required. it's a subroutine reference that can be used to start the Catalyst server. no start_sub, no server, no vibes π
β¨ 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. iconic behavior honestly π₯
it's giving: watch β change β kill β re-fork β fresh server β repeat. main character loop energy π
π SEE ALSO
CatalystFile::ChangeNotify
π AUTHORS
Catalyst Contributors, see Catalyst.pm π
β COPYRIGHT
this program is free software, you can redistribute it and/or modify it under the same terms as Perl itself. free as in freedom bestie, go wild π
kay so this page was served up by perl v5.30.3, dated 2020-09-13, and it lives under Cataly...starter(3pm) in the User Contributed Perl Documentation. mwah, go restart something π β¨
π¦ where this page comes from
- debian bookworm: libcatalyst-devel-perl 1.42-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libcatalyst-devel-perl 1.42-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu jammy: libcatalyst-devel-perl 1.42-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libcatalyst-devel-perl 1.42-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libcatalyst-devel-perl 1.42-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libcatalyst-devel-perl 1.42-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms