GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  DANCER2::CORE::DISPATCHER (3)

.ds Aq ’

NAME

Dancer2::Core::Dispatcher - Class for dispatching request to the appropriate route handler

CONTENTS

VERSION

version 0.166001

SYNOPSIS



    use Dancer2::Core::Dispatcher;

    # Create an instance of dispatcher
    my $dispatcher = Dancer2::Core::Dispatcher->new( apps => [$app] );

    # Dispatch a request
    my $resp = $dispatcher->dispatch($env)->to_psgi;

    # Capture internal error of a response (if any) after a dispatch
    $dispatcher->response_internal_error($app, $error);

    # Capture response not found for an application the after dispatch
    $dispatcher->response_not_found($env);



ATTRIBUTES

    apps

The apps is an array reference to Dancer2::Core::App.

    default_content_type

The default_content_type is a string which represents the context of the request. This attribute is read-only.

METHODS

    dispatch

The dispatch method accepts the list of applications, hash reference for the <B>envB> attribute of Dancer2::Core::Request and optionally the request object and an env as input arguments.

dispatch returns a response object of Dancer2::Core::Response.

Any before hook and matched route code is wrapped using Return::MultiLevel to allow DSL keywords such as forward and redirect to short-circuit remaining code without having to throw an exception. Return::MultiLevel will use Scope::Upper (an XS module) if it is available.

    response_internal_error

The response_internal_error takes as input the list of applications and a variable error and returns an object of Dancer2::Core::Error.

    response_not_found

The response_not_found consumes as input the list of applications and an object of type Dancer2::Core::App and returns an object Dancer2::Core::Error.

AUTHOR

Dancer Core Developers

COPYRIGHT AND LICENSE

This software is copyright (c) 2015 by Alexis Sukrieh.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.

Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 DANCER2::CORE::DISPATCHER (3) 2016-01-22

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.