Daemonise

 view release on metacpan or  search on metacpan

lib/Daemonise.pm  view on Meta::CPAN

package Daemonise;

use Modern::Perl;
use Mouse;
use File::Basename;
use FindBin qw($Bin);
use lib "$Bin/../lib";

# ABSTRACT: Daemonise - a general daemoniser for anything...

our $VERSION = '2.13'; # VERSION

use Config::Any;
use POSIX qw(strftime SIGTERM SIG_BLOCK SIG_UNBLOCK);


has 'name' => (
    is        => 'rw',
    default   => sub { (my $name = basename($0)) =~ s/\.[^.]+$//; $name },
    predicate => 'has_name',
);


has 'hostname' => (
    is      => 'ro',
    isa     => 'Str',
    lazy    => 1,
    builder => 'build_hostname',
);


has 'config_file' => (
    is        => 'rw',
    isa       => "Str",
    predicate => 'has_config_file',
);


has 'config' => (
    is      => 'rw',
    isa     => 'HashRef',
    lazy    => 1,
    default => sub { {} },
);


has 'debug' => (
    is      => 'rw',
    isa     => 'Bool',
    lazy    => 1,
    default => sub { 0 },
);


has 'start_time' => (
    is      => 'rw',
    isa     => 'Int',
    default => sub { time },
);


has 'is_cron' => (
    is      => 'rw',

 view all matches for this distribution
 view release on metacpan -  search on metacpan

( run in 1.781 second using v1.00-cache-2.02-grep-82fe00e-cpan-48ebf85a1963 )