NAME
Mojo::Server::DaemonControl::Worker - A Mojolicious daemon that can shutdown gracefully
SYNOPSIS
use Mojo::Server::DaemonControl::Worker;
my $daemon = Mojo::Server::DaemonControl::Worrker->new(listen => ['http://*:8080']);
$daemon->run;
DESCRIPTION
Mojo::Server::DaemonControl::Worker is a sub class of Mojo::Server::Daemon, that is used by Mojo::Server::DaemonControl to support graceful shutdown and hot deployment.
SIGNALS
The Mojo::Server::DaemonControl::Worker process can be controlled by the same signals as Mojo::Server::Daemon, but it also supports the following signals.
QUIT
Used to shut down the server gracefully.
EVENTS
Mojo::Server::DaemonControl::Worker inherits all events from Mojo::Server::Daemon.
ATTRIBUTES
Mojo::Server::DaemonControl::Worker inherits all attributes from Mojo::Server::Daemon and implements the following ones.
heartbeat_interval
$int = $daemon->heartbeat_interval;
$daemon = $daemon->heartbeat_interval(2.5);
Heartbeat interval in seconds. See "heartbeat_interval" in Mojo::Server::DaemonControl::Worker for more details.
manager_pid
$int = $daemon->manager_pid;
Holds the PID of the Mojo::Server::DaemonControl process.
silent
$bool = $daemon->silent;
$daemon = $daemon->silent(1);
Changes the default in "silent" in Mojo::Server::Daemon to 1.
METHODS
Mojo::Server::DaemonControl::Worker inherits all methods from Mojo::Server::Daemon and implements the following ones.
run
$daemon->run($app);
Load $app
using "load_app" in Mojo::Server and run server and wait for "SIGNALS".