NAME
Plack::Server - Standard interface for Plack implementations
SYNOPSIS
package FooBarServer;
sub new {
my($class, %opt) = @_;
...
return $self;
}
sub run {
my($self, $app) = @_;
# launch the server and run $app in the loop
}
# then from command line
plackup -s +FooBarServer -a app.psgi
DESCRIPTION
Plack::Server is an abstract interface (but not actually a base class) of Plack PSGI implementations. As long as they implement the methods defined as an Server unified interface, they do not need to inherit Plack::Server.
METHODS
- new
-
$server = FooBarServer->new(%args);
Creates a new implementation object. %args can take arbitrary parameters per implementations but common parameters are:
- port
-
Port number the server listens to.
- host
-
Address the server listens to. Set to undef to listen any interface.
- run
-
$server->run($app);
Starts the server process and when a request comes in, run the PSGI application passed in
$app
in the loop. - register_service
-
$server->register_service($app);
Optional interface if your server should run in parallel with other event loop, particularly AnyEvent. This is the same as
run
but doen's run the main loop.
SEE ALSO
rackup
1 POD Error
The following errors were encountered while parsing the POD:
- Around line 24:
Non-ASCII character seen before =encoding in ' }'. Assuming UTF-8