The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.
#!/usr/bin/perl
use strict;
use lib "lib";
use Plack::Runner;

my @argv = @ARGV;

my $runner = Plack::Runner->new(server => 'Starman', env => 'production');
$runner->parse_options(@argv);
$runner->set_options(argv => \@argv) if $runner->can('set_options');
$runner->run;

__END__

=head1 NAME

starman - Starman launcher

=head1 SYNOPSIS

  starman --listen :5001 --listen /tmp/starman.sock
  starman --workers 32 --port 8080

=over 4

=item -l, --listen

  --listen HOST:PORT --listen PORT --listen UNIX_SOCKET

Specifies the TCP address, ports and UNIX domain sockets to bind to
wait for requests. You can repeat as many times as you want and mix
TCP and UNIX domain sockets.

Defaults to any IP address and port 5000.

=item --host

  --host 127.0.0.1

Specifies the address to bind.

This option is for a compatiblity with L<plackup> and you're
recommended to use C<--listen> instead.

=item --port

  --port 8080

Specifies the port to bind.

This option is for a compatiblity with L<plackup> and you're
recommended to use C<--listen> instead.

=item -S, --socket

  -S /tmp/starman.sock

Specifies the path to UNIX domain socket to bind.

This option is for a compatiblity with L<plackup> and you're
recommended to use C<--listen> instead.

=item --workers

Specifies the number of worker pool. Defaults to 5.

Starman by default sets up other spare server configuration based on this
workers value, making sure there are B<always only> C<N> worker
processes running. So even if there're no idle workers, Starman won't
spawn off spare processes since that's mostly what you want to do by
fine tuning the memory usage etc. in the production environment.

=item --max-requests

Number of the requests to process per one worker process. Defaults to 1000.

=back

See `plackup -h` for more options.

=head1 SEE ALSO

L<Starman>

=cut