XAS::Service::Server - Perl extension for the XAS environment
use XAS::Service::Server; my $interface = XAS::Service::Server->new( -alias => 'server', -port => 9507, -address => 'localhost, -app => $self->build_app($schema), ); $interface->run();
This module provides a basic web server based on POE. It binds the POE environment to the Plack environment. It's primary mission is to run Web::Machine. This allows for the building of REST based web services quickly and easily. Which also allows the same code base to run as a daemon on UNIX/Linux and a service on Windows.
This module inherits from XAS::Lib::Net::Server and takes these additional parameters:
This should be a complied Plack application.
This event will process the input from the client. This method will take the HTTP::Request and format it so the Plack application can use the request. The response from the application is then reformated into a HTTP::Response which is sent back to the client. It also sets up a synchronous pipeline to handle this response.
It takes the following parameters:
The input received from the socket.
A hash variable to maintain context. This will be initialized with a "wheel" field. Others fields may be added as needed.
This event will process the output for the client. It continues the synchronous pipeline to handle this response.
The output to be sent to the socket.
A hash variable to maintain context. This uses the "wheel" field to direct output to the correct socket. Others fields may have been added as needed.
Kevin L. Esteb, <kevin@kesteb.us>
Copyright (c) 2012-2016 Kevin L. Esteb
This is free software; you can redistribute it and/or modify it under the terms of the Artistic License 2.0. For details, see the full text of the license at http://www.perlfoundation.org/artistic_license_2_0.
To install XAS::Service, copy and paste the appropriate command in to your terminal.
cpanm
cpanm XAS::Service
CPAN shell
perl -MCPAN -e shell install XAS::Service
For more information on module installation, please visit the detailed CPAN module installation guide.