Async::MicroserviceReq - async microservice request class
my $this_req = Async::MicroserviceReq->new( method => $plack_req->method, headers => $plack_req->headers, content => $plack_req->content, path => $plack_req->path_info, params => $plack_req->parameters, static_dir => $self->static_dir, ); ... my $plack_handler_sub = sub { my ($plack_respond) = @_; $this_req->plack_respond($plack_respond); ...
This is an object created for each request handled by Async::Microservice. It is passed to all request handling functions as first argument and it provides some request info and response helper methods.
method headers path params plack_respond static_dir base_url want_json content json_content
Send text plain response.
Send plack response.
Send redirect.
Send static file, can be updated/modified using optional callback.
Returns number of currently pending async requests.
To install Async::Microservice, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Async::Microservice
CPAN shell
perl -MCPAN -e shell install Async::Microservice
For more information on module installation, please visit the detailed CPAN module installation guide.