Skip to content

Commit

Permalink
shortcuts for all prefork options
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Feb 25, 2015
1 parent 6aa6b01 commit 9b758ca
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
2 changes: 2 additions & 0 deletions Changes
Expand Up @@ -32,8 +32,10 @@
descendant_nodes, child_nodes, following_nodes, next_node, preceding_nodes
and previous_node.
- Renamed params method in Mojo::Parameters to pairs.
- Renamed -A option of prefork command to -a.
- Added names method to Mojo::Parameters.
- Added failed and passed methods to Mojolicious::Validator::Validation.
- Added -I and -M options to prefork command.

5.82 2015-02-22
- Deprecated Mojo::Reactor::is_readable.
Expand Down
24 changes: 12 additions & 12 deletions lib/Mojolicious/Command/prefork.pm
Expand Up @@ -13,21 +13,21 @@ sub run {

my $prefork = Mojo::Server::Prefork->new(app => $self->app);
GetOptionsFromArray \@args,
'A|accepts=i' => sub { $prefork->accepts($_[1]) },
'a|accepts=i' => sub { $prefork->accepts($_[1]) },
'b|backlog=i' => sub { $prefork->backlog($_[1]) },
'c|clients=i' => sub { $prefork->max_clients($_[1]) },
'G|graceful-timeout=i' => sub { $prefork->graceful_timeout($_[1]) },
'g|group=s' => sub { $prefork->group($_[1]) },
'heartbeat-interval=i' => sub { $prefork->heartbeat_interval($_[1]) },
'I|heartbeat-interval=i' => sub { $prefork->heartbeat_interval($_[1]) },
'H|heartbeat-timeout=i' => sub { $prefork->heartbeat_timeout($_[1]) },
'i|inactivity-timeout=i' => sub { $prefork->inactivity_timeout($_[1]) },
'l|listen=s' => \my @listen,
'multi-accept=i' => sub { $prefork->multi_accept($_[1]) },
'P|pid-file=s' => sub { $prefork->pid_file($_[1]) },
'p|proxy' => sub { $prefork->reverse_proxy(1) },
'r|requests=i' => sub { $prefork->max_requests($_[1]) },
'u|user=s' => sub { $prefork->user($_[1]) },
'w|workers=i' => sub { $prefork->workers($_[1]) };
'l|listen=s' => \my @listen,
'M|multi-accept=i' => sub { $prefork->multi_accept($_[1]) },
'P|pid-file=s' => sub { $prefork->pid_file($_[1]) },
'p|proxy' => sub { $prefork->reverse_proxy(1) },
'r|requests=i' => sub { $prefork->max_requests($_[1]) },
'u|user=s' => sub { $prefork->user($_[1]) },
'w|workers=i' => sub { $prefork->workers($_[1]) };

$prefork->listen(\@listen) if @listen;
$prefork->run;
Expand All @@ -51,22 +51,22 @@ Mojolicious::Command::prefork - Prefork command
./myapp.pl prefork -l 'https://*:443?cert=./server.crt&key=./server.key'
Options:
-A, --accepts <number> Number of connections for workers to
-a, --accepts <number> Number of connections for workers to
accept, defaults to 1000
-b, --backlog <size> Listen backlog size, defaults to
SOMAXCONN
-c, --clients <number> Maximum number of concurrent
connections, defaults to 1000
-G, --graceful-timeout <seconds> Graceful timeout, defaults to 20.
-g, --group <name> Group name for process
--heartbeat-interval <seconds> Heartbeat interval, defaults to 5
-I, --heartbeat-interval <seconds> Heartbeat interval, defaults to 5
-H, --heartbeat-timeout <seconds> Heartbeat timeout, defaults to 20
-i, --inactivity-timeout <seconds> Inactivity timeout, defaults to the
value of MOJO_INACTIVITY_TIMEOUT or 15
-l, --listen <location> One or more locations you want to
listen on, defaults to the value of
MOJO_LISTEN or "http://*:3000"
--multi-accept <number> Number of connections to accept at
-M, --multi-accept <number> Number of connections to accept at
once, defaults to 50
-P, --pid-file <path> Path to process id file, defaults to a
random file
Expand Down

0 comments on commit 9b758ca

Please sign in to comment.