POEx-Role-PSGIServer

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

        under 5.12 perls.  Oy ve.

1.103331  2010-11-29 10:18:00 America/New_York
        Declare dependency on latest POEx::Role::TCPServer and use around for
		BUILDARGS rather than method.

1.102531  2010-09-10 13:11:09 America/Los_Angeles
        Throw some defaults on listen_ip and listen_port so we don't explode when plackup doesn't pass them to us (frodwith)

1.102530  2010-09-10 12:14:32 America/Los_Angeles
        Some bugs (poll_cb) in the streaming interface fixed, along with a small test fix (frodwith)

1.101040  2010-04-14 08:35:12 America/Chicago
        BUILDARGS needs to return /all/ of the args, not just the ones Plack cares about

1.101020  2010-04-12 15:39:30 America/Chicago
        Initial Release

MANIFEST  view on Meta::CPAN

META.json
META.yml
Makefile.PL
README
dist.ini
lib/POEx/Role/PSGIServer.pm
lib/POEx/Role/PSGIServer/ProxyWriter.pm
lib/POEx/Role/PSGIServer/Streamer.pm
lib/POEx/Types/PSGIServer.pm
t/lib/MyTester.pm
t/streaming.t
t/suite.t
weaver.ini

lib/POEx/Role/PSGIServer.pm  view on Meta::CPAN

        return POEx::Role::PSGIServer::ProxyWriter->new(server_context => $c, proxied => $self);
    }


    method generate_psgi_env(PSGIServerContext $c) returns (HashRef) {
        return req_to_psgi(
            $c->{request},
            SERVER_NAME         => $self->listen_ip,
            SERVER_PORT         => $self->listen_port,
            SERVER_PROTOCOL     => $c->{protocol},
            'psgi.streaming'    => Plack::Util::TRUE,
            'psgi.nonblocking'  => Plack::Util::TRUE,
            'psgi.runonce'      => Plack::Util::FALSE,
        );
    }


    method build_server_context(HTTPRequest $req, WheelID $wheel_id) returns (PSGIServerContext) {
        my $version  = $req->header('X-HTTP-Version') || '0.9';
        my $protocol = "HTTP/$version";
        my $connection = $req->header('Connection') || '';

lib/POEx/Role/PSGIServer.pm  view on Meta::CPAN

    MyServer->new()->run($some_psgi_app);

=head1 DESCRIPTION

This module has been deprecated.

POEx::Role::PSGIServer encapsulates the core L<PSGI> server behaviors into an easy to consume and extend role. It is based on previous POEx work such as POEx::Role::TCPServer which provides basic TCP socket multiplexing via POE::Wheel::SocketFactory ...

=head2 RATIONALE

This Role has its roots firmly planted in POE::Component::Server::PSGI which provided the initial seed with the layout and logic of the basic server. Unfortunately, POE::Component::Server::PSGI didn't provide any mechnism for extension. The main goal...

=head1 CLASS_METHODS

=head2 around BUILDARGS

    (ClassName $class: @args)

BUILDARGS is wrapped to translate from the expected Plack::Handler interface to POEx::Role::TCPServer's expected interface.

=head1 PUBLIC_ATTRIBUTES

lib/POEx/Role/PSGIServer/Streamer.pm  view on Meta::CPAN

package POEx::Role::PSGIServer::Streamer;
$POEx::Role::PSGIServer::Streamer::VERSION = '1.150280';
#ABSTRACT: (DEPRECATED) Provides streaming filehandle PSGI implementation
use MooseX::Declare;

class POEx::Role::PSGIServer::Streamer {
    use POE::Filter::Map;
    use POE::Filter::Stream;
    use MooseX::Types::Moose(':all');
    use POEx::Types::PSGIServer(':all');
    

    has server_context => (is => 'ro', isa => PSGIServerContext, required => 1);

lib/POEx/Role/PSGIServer/Streamer.pm  view on Meta::CPAN

}

1;

__END__

=pod

=head1 NAME

POEx::Role::PSGIServer::Streamer - (DEPRECATED) Provides streaming filehandle PSGI implementation

=head1 VERSION

version 1.150280

=head1 PUBLIC_ATTRIBUTES

=head2 server_context

    is: ro, isa: PSGIServerContext, required: 1

t/streaming.t  view on Meta::CPAN


                $write->([
                    200,
                    [ 'Content-Type' => 'text/plain', ],
                    [ 'Hello, ' . $env->{QUERY_STRING} ],
                ]);
            }
        },
    ],
    [
        'coderef streaming',
        sub {
            my $cb = shift;
            my $res = $cb->(GET "http://127.0.0.1/?name=miyagawa");
            is $res->code, 200;
            is $res->header('content_type'), 'text/plain';
            is $res->content, 'Hello, name=miyagawa';
        },
        sub {
            my $env = shift;



( run in 0.290 second using v1.01-cache-2.11-cpan-4d50c553e7e )