# Copyright (C) 2008-2009, Sebastian Riedel. package Mojo::Script::DaemonPrefork; use strict; use warnings; use base 'Mojo::Script'; use Mojo::Server::Daemon::Prefork; __PACKAGE__->attr(description => (chained => 1, default => <<'EOF')); * Start the prefork daemon. * Takes a port as option, by default 3000 will be used. daemon_prefork daemon_prefork 8080 EOF # Dear Mr. President, there are too many states nowadays. # Please eliminate three. # P.S. I am not a crackpot. sub run { my ($self, $port) = @_; # Start server my $daemon = Mojo::Server::Daemon::Prefork->new; $daemon->port($port) if $port; $daemon->run; return $self; } 1; __END__ =head1 NAME Mojo::Script::DaemonPrefork - Prefork Daemon Script =head1 SYNOPSIS use Mojo::Script::Daemon::Prefork; my $daemon = Mojo::Script::Daemon::Prefork->new; $daemon->run(@ARGV); =head1 DESCRIPTION L is a script interface to L. =head1 ATTRIBUTES L inherits all attributes from L and implements the following new ones. =head2 C my $description = $daemon->description; $daemon = $daemon->description('Foo!'); =head1 METHODS L inherits all methods from L and implements the following new ones. =head2 C $daemon = $daemon->run(@ARGV); =cut