NAME

Mojo::Server::Daemon - HTTP Server

SYNOPSIS

use Mojo::Server::Daemon;

my $daemon = Mojo::Server::Daemon->new;
$daemon->port(8080);
$daemon->run;

DESCRIPTION

Mojo::Server::Daemon is a simple and portable async io based HTTP server.

ATTRIBUTES

Mojo::Server::Daemon inherits all attributes from Mojo::Server and implements the following new ones.

group

my $group = $daemon->group;
$daemon   = $daemon->group('users');

keep_alive_timeout

my $keep_alive_timeout = $daemon->keep_alive_timeout;
$daemon                = $daemon->keep_alive_timeout(15);

listen_queue_size

my $listen_queue_size = $daemon->listen_queue_zise;
$daemon               = $daemon->listen_queue_zise(128);

max_clients

my $max_clients = $daemon->max_clients;
$daemon         = $daemon->max_clients(1000);

max_keep_alive_requests

my $max_keep_alive_requests = $daemon->max_keep_alive_requests;
$daemon                     = $daemon->max_keep_alive_requests(100);

port

my $port = $daemon->port;
$daemon  = $daemon->port(3000);

user

my $user = $daemon->user;
$daemon  = $daemon->user('web');

METHODS

Mojo::Server::Daemon inherits all methods from Mojo::Server and implements the following new ones.

accept_lock

my $locked = $daemon->accept_lock;
my $locked = $daemon->accept_lock(1);

accept_unlock

$daemon->accept_unlock;

listen

$daemon->listen;

run

$daemon->run;

setuidgid

$daemon->setuidgid;

spin

$daemon->spin;