Zing::Daemon - Process Daemon
Daemon Process Management
use Zing::Cartridge; use Zing::Daemon; my $daemon = Zing::Daemon->new( cartridge => Zing::Cartridge->new( name => 'example', scheme => ['MyApp', [], 1], ) ); # $daemon->start;
This package provides the mechanisms for running a Zing application as a daemon process.
This package inherits behaviors from:
Zing::Entity
This package uses type constraints from:
Zing::Types
This package has the following attributes:
cartridge(Cartridge)
This attribute is read-only, accepts (Cartridge) values, and is required.
(Cartridge)
journal(Journal)
This attribute is read-only, accepts (Journal) values, and is optional.
(Journal)
kernel(Zing)
This attribute is read-only, accepts (Zing) values, and is optional.
(Zing)
log_filter_from(Str)
This attribute is read-only, accepts (Str) values, and is optional.
(Str)
log_filter_queries(ArrayRef[Str])
This attribute is read-only, accepts (ArrayRef[Str]) values, and is optional.
(ArrayRef[Str])
log_filter_tag(Str)
log_level(Str)
log_reset(Bool)
This attribute is read-only, accepts (Bool) values, and is optional.
(Bool)
log_verbose(Bool)
logger(Logger)
This attribute is read-only, accepts (Logger) values, and is optional.
(Logger)
This package implements the following methods:
fork() : Int
The fork method forks the application and returns a pid.
# given: synopsis my $pid = $daemon->fork;
restart() : Bool
The restart method stops and then starts the application and creates a pid file under the "pidfile" in Zing::Cartridge.
use FlightRecorder; use Zing::Cartridge; use Zing::Daemon; my $daemon = Zing::Daemon->new( logger => FlightRecorder->new(auto => undef), cartridge => Zing::Cartridge->new( name => 'example', scheme => ['MyApp', [], 1], ) ); $daemon->restart;
start() : Bool
The start method forks the application and creates a pid file under the "pidfile" in Zing::Cartridge.
use FlightRecorder; use Zing::Cartridge; use Zing::Daemon; my $daemon = Zing::Daemon->new( logger => FlightRecorder->new(auto => undef), cartridge => Zing::Cartridge->new( name => 'example', scheme => ['MyApp', [], 1], ) ); $daemon->start;
stop() : Bool
The stop method stops the application and removes the pid file under the "pidfile" in Zing::Cartridge.
use FlightRecorder; use Zing::Cartridge; use Zing::Daemon; my $daemon = Zing::Daemon->new( logger => FlightRecorder->new(auto => undef), cartridge => Zing::Cartridge->new( name => 'example', scheme => ['MyApp', [], 1], ) ); $daemon->stop;
Al Newkirk, awncorp@cpan.org
awncorp@cpan.org
Copyright (C) 2011-2019, Al Newkirk, et al.
This is free software; you can redistribute it and/or modify it under the terms of the The Apache License, Version 2.0, as elucidated in the "license file".
Wiki
Project
Initiatives
Milestones
Contributing
Issues
To install Zing, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Zing
CPAN shell
perl -MCPAN -e shell install Zing
For more information on module installation, please visit the detailed CPAN module installation guide.