| 1 | package FCGI::Engine::Manager::Server::Plackup; | ||
| 2 | use Moose; | ||
| 3 | |||
| 4 | our $VERSION = '0.22'; | ||
| 5 | our $AUTHORITY = 'cpan:STEVAN'; | ||
| 6 | |||
| 7 | extends 'FCGI::Engine::Manager::Server'; | ||
| 8 | |||
| 9 | has 'server_type' => ( | ||
| 10 | is => 'ro', | ||
| 11 | isa => 'Str', | ||
| 12 | default => sub { 'FCGI::Engine' } | ||
| 13 | ); | ||
| 14 | |||
| 15 | has 'workers' => ( | ||
| 16 | is => 'ro', | ||
| 17 | isa => 'Int' | ||
| 18 | ); | ||
| 19 | |||
| 20 | sub construct_command_line { | ||
| 21 | my $self = shift; | ||
| 22 | return ("plackup", | ||
| 23 | $self->scriptname, | ||
| 24 | "--server", | ||
| 25 | $self->server_type, | ||
| 26 | ( $self->workers ? ( "--workers", $self->workers ) : ( "--nproc", $self->nproc ) ), | ||
| 27 | "--pid", | ||
| 28 | $self->pidfile, | ||
| 29 | "--listen", | ||
| 30 | $self->socket, | ||
| 31 | "--daemonize", | ||
| 32 | ($self->has_additional_args | ||
| 33 | ? $self->additional_args | ||
| 34 | : ())); | ||
| 35 | } | ||
| 36 | |||
| 37 | __PACKAGE__->meta->make_immutable; | ||
| 38 | |||
| 39 | no Moose; 1; | ||
| 40 | |||
| 41 | __END__ |