Plack-Server-AnyEvent

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN


0.04  Mon May 17 12:28:08 PDT 2010
        - This software is now deprecated. Use Twiggy

0.03  Wed Nov 11 21:33:16 PST 2009
        - Merged nothingmuch's fork to make the socket handling much faster (twice as fast!)
        - Fixed poll_cb and writer shutdown
        - Implemented graceful exit on SIGQUIT (nothingmuch)

0.02  Thu Oct 29 12:38:15 PDT 2009
        - Support psgi.streaming and condvar response for delayed response (nothingmuch)
        - Improved error handling, memory usage and performance by not using AnyEvent::Handle (nothingmuch)

0.01  Mon Oct 12 23:31:52 2009
        - original version

README  view on Meta::CPAN

SYNOPSIS
      my $server = Plack::Server::AnyEvent->new(
          host => $host,
          port => $port,
      );
      $server->run($app);

DESCRIPTION
    Plack::Server::AnyEvent is a Plack server implementation using AnyEvent.
    This server runs in a non-blocking event loop and suitable for
    event-driven web applications like streaming API servers.

LICENSE
    This module is licensed under the same terms as Perl itself.

AUTHOR
    Tokuhiro Matsuno

    Yuval Kogman

    Tatsuhiko Miyagawa

lib/Plack/Server/AnyEvent.pm  view on Meta::CPAN

        my $try_parse = sub {
            if ( $self->_try_read_headers($sock, $headers) ) {
                my $env = {
                    SERVER_PORT         => $self->{prepared_port},
                    SERVER_NAME         => $self->{prepared_host},
                    SCRIPT_NAME         => '',
                    'psgi.version'      => [ 1, 0 ],
                    'psgi.errors'       => *STDERR,
                    'psgi.url_scheme'   => 'http',
                    'psgi.nonblocking'  => Plack::Util::TRUE,
                    'psgi.streaming'    => Plack::Util::TRUE,
                    'psgi.run_once'     => Plack::Util::FALSE,
                    'psgi.multithread'  => Plack::Util::FALSE,
                    'psgi.multiprocess' => Plack::Util::FALSE,
                    'psgi.input'        => $sock,
                    'REMOTE_ADDR'       => $peer_host,
                };

                my $reqlen = parse_http_request($headers, $env);

                if ( $reqlen < 0 ) {

lib/Plack/Server/AnyEvent.pm  view on Meta::CPAN

  my $server = Plack::Server::AnyEvent->new(
      host => $host,
      port => $port,
  );
  $server->run($app);

=head1 DESCRIPTION

Plack::Server::AnyEvent is a Plack server implementation using
AnyEvent. This server runs in a non-blocking event loop and suitable
for event-driven web applications like streaming API servers.

=head1 LICENSE

This module is licensed under the same terms as Perl itself.

=head1 AUTHOR

Tokuhiro Matsuno

Yuval Kogman

t/anyevent_extensions.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.349 second using v1.01-cache-2.11-cpan-4d50c553e7e )