view release on metacpan or search on metacpan
t/response_has_redundant_body.t view on Meta::CPAN
my $respond = shift;
$respond->( [304, [ "Content-Type" => 'text/plain' ], ['OK']] );
};
};
# streaming response
mount '/code_200_writer' => sub {
sub {
my $respond = shift;
my $writer = $respond->( [200, [ "Content-Type" => 'text/plain' ]] );
$writer->write( ref($writer) );
t/response_has_redundant_body.t view on Meta::CPAN
[ '/code_304_delayed',
'',
304,
'text/plain' ],
# streaming response
[ '/code_200_writer',
'Plack::Util::Prototype',
200,
'text/plain' ],
[ '/code_304_writer',
view all matches for this distribution
view release on metacpan or search on metacpan
1.007 Tue 12 Feb 2013
- Default body in middleware-generated redirect responses
1.006 Thu 27 Dec 2012
- Fix for buggy interaction with streaming
1.005 Thu 07 Jun 2012
- Pre-existing Location header in fabricated responses now preserved
1.004 Thu 29 Mar 2012
view all matches for this distribution
view release on metacpan or search on metacpan
- repackaging with Minilla
- faster response for normal PSGI $res
0.03 Tue Aug 7 17:00:14 2012
- fixed for streaming response (Thank you motemen-san)
0.02 Mon Mar 19 17:55:28 2012
- fixed for callback response
0.01 Fri Nov 5 16:53:39 2010
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Plack/Middleware/Session.pm view on Meta::CPAN
=item I<late_store>
If set to a true value, the session will be saved at the I<end> of the
request, after all data has been sent to the client -- this may be
required if streaming responses attempt to alter the session after the
header has already been sent to the client. Note, however, that it
introduces a possible race condition, where the server attempts to store
the updated session before the client makes the next request. For
redirects, or other responses on which the client needs do minimal
processing before making a second request, this race is quite possible
view all matches for this distribution
view release on metacpan or search on metacpan
- Testing with HTTP::CookieJar to avoid HTTP::Cookies RFC6265 non-compliance
- No more parent.pm dependency
- Updated packaging and package metadata
1.203 Mon 31 Aug 2020
- Support for streaming PSGI apps.
1.202 Mon 18 Dec 2017
- Fix for another accidental 5.10-ism in the tests.
No module code changes.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Plack/Middleware/Signposting/Catmandu.pm view on Meta::CPAN
# see http://search.cpan.org/~miyagawa/Plack-1.0044/lib/Plack/Middleware.pm#RESPONSE_CALLBACK
return $self->response_cb($res, sub {
my $res = shift;
# ignore streaming response for now
return unless ref $res->[2] eq 'ARRAY';
my $data = $bag->get($id) || return;
$fixer->fix($data);
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Plack/Middleware/SocketIO.pm view on Meta::CPAN
All the transports are supported.
WebSocket
Adobe(R) Flash(R) Socket
AJAX long polling
AJAX multipart streaming
Forever Iframe
JSONP Polling
=head2 TLS/SSL
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Plack/Middleware/StackTrace/RethrowFriendly.pm
minil.toml
t/00_compile.t
t/01_basic.t
t/02_force.t
t/03_streaming.t
t/04_utf8.t
t/05_sigdie.t
t/06_rethrow.t
t/07_multiple_exceptions.t
META.yml
view all matches for this distribution
view release on metacpan or search on metacpan
Makefile.PL
README
lib/Plack/Middleware/SuppressResponseCodes.pm
t/00_compile.t
t/10_codes.t
t/20_streaming.t
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Plack/Middleware/Test/StashWarnings.pm view on Meta::CPAN
return [ 200, ["Content-Type", "application/x-storable"], [ $self->dump_warnings ] ];
}
my $ret = $self->_stash_warnings_for($self->app, $env);
# for the streaming API, we need to re-instate the dynamic sigwarn handler
# around the streaming callback
if (ref($ret) eq 'CODE') {
return sub { $self->_stash_warnings_for($ret, @_) };
}
return $ret;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Plack/Middleware/TrafficLog.pm view on Meta::CPAN
This module works also with applications that have delayed response. In that
case, each chunk is logged separately and shares the same unique ID number and
headers.
The body of the request and response is not logged by default. For streaming
responses, only the first chunk is logged by default.
=for readme stop
=cut
lib/Plack/Middleware/TrafficLog.pm view on Meta::CPAN
The true value enables logging of the message's body.
=item with_all_chunks
The true value enables logging of every chunk for streaming responses.
=item eol
Sets the line separator for the message's headers and the body. The default
value is the pipe character C<|>.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Plack/Middleware/XSLT.pm view on Meta::CPAN
$headers->set('Content-Length', length($output));
$res->[2] = [ $output ];
}
}
else {
# PSGI streaming
my ($done, @chunks);
return sub {
my $chunk = shift;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Plack/Middleware/XSRFBlock.pm view on Meta::CPAN
=head2 filter_response_html($self, $request, $env, $res, $token)
Filters the response, injecting C<< <input> >> elements with the token
value into all forms whose method matches C<http_method_regex>.
Streaming responses are still streaming after the filtering.
=head2 filter_response($self, $request, $env)
Calls the application, and (if the response L<< /C<should_be_filtered>
>>), it injects the token in the cookie and (if L<<
view all matches for this distribution
view release on metacpan or search on metacpan
1.100830 2010-03-24 15:08:11 EST5EDT
Switched to Dist::Zilla
0.02 2010-03-23
Manifest generation moved to middleware constructor
Now handles streaming apps (like Plack:App::Proxy)
0.01 2010-03-22
First version, released on an unsuspecting world.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Plack/Server/AnyEvent.pm view on Meta::CPAN
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,
lib/Plack/Server/AnyEvent.pm view on Meta::CPAN
=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.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Plack/Server/Coro.pm view on Meta::CPAN
'psgi.url_scheme' => 'http', # SSL support?
'psgi.nonblocking' => Plack::Util::TRUE,
'psgi.run_once' => Plack::Util::FALSE,
'psgi.multithread' => Plack::Util::TRUE,
'psgi.multiprocess' => Plack::Util::FALSE,
'psgi.streaming' => Plack::Util::TRUE,
};
my $res = [ 400, [ 'Content-Type' => 'text/plain' ], [ 'Bad Request' ] ];
my $buf = '';
lib/Plack/Server/Coro.pm view on Meta::CPAN
push @lines, "\015\012";
$fh->syswrite(join '', @lines);
if (!defined $res->[2]) {
# streaming write
return Plack::Util::inline_object
write => sub { $fh->syswrite(join '', @_) },
close => $rouse_cb;
} elsif ($HasAIO && Plack::Util::is_real_fh($res->[2])) {
my $length = -s $res->[2];
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Plack/Test/AnyEvent.pm view on Meta::CPAN
my $cb = sub {
my ( $req ) = @_;
$req->uri->scheme('http') unless defined $req->uri->scheme;
$req->uri->host('localhost') unless defined $req->uri->host;
my $env = $req->to_psgi;
$env->{'psgi.streaming'} = 1;
$env->{'psgi.nonblocking'} = 1;
my $res = $app->($env);
if(ref($res) eq 'CODE') {
lib/Plack/Test/AnyEvent.pm view on Meta::CPAN
$Plack::Test::Impl = 'AnyEvent'; # or 'AE' for short
test_psgi $app, sub {
my ( $cb ) = @_;
my $res = $cb->(GET '/streaming-response');
is $res->header('Transfer-Encoding'), 'chunked';
$res->on_content_received(sub {
my ( $content ) = @_;
# test chunk of streaming response
});
$res->recv;
}
=head1 DESCRIPTION
This L<Plack::Test> implementation allows you to easily test your
L<AnyEvent>-based PSGI applications. Normally, L<Plack::Test::MockHTTP>
or L<Plack::Test::Server> work fine for this, but this implementation comes
in handy when you'd like to test your streaming results as they come in, or
if your application uses long-polling. For non-streaming requests, you can
use this module exactly like Plack::Test::MockHTTP; otherwise, you can set
up a content handler and call C<$res-E<gt>recv>. The event loop will then
run until the PSGI application closes its writer handle or until your test
client calls C<send> on the response.
lib/Plack/Test/AnyEvent.pm view on Meta::CPAN
return sub {
my ( $respond ) = @_;
die 'still thrown by $cb';
if($streaming) {
my $writer = $respond->([
200,
['Content-Type' => 'text/plain'],
]);
lib/Plack/Test/AnyEvent.pm view on Meta::CPAN
=back
This list isn't exclusive; ie. just because your event loop isn't on this list
doesn't mean it doesn't work. Also, even if your event loop doesn't pass
the exception tests, the general usage of this module (testing requests,
handling streaming results and long polling) should work on any AnyEvent loop.
Just don't throw any uncaught exceptions =).
=head1 SEE ALSO
L<AnyEvent>, L<Plack>, L<Plack::Test>
view all matches for this distribution
view release on metacpan or search on metacpan
t/samples/rss-20.xml view on Meta::CPAN
<webMaster>dave@userland.com (Dave Winer)</webMaster>
<generator>Weblog Editor 2.0</generator>
<item>
<title>Foo Bar</title>
<link>http://liftoff.msfc.nasa.gov/news/2003/news-starcity.asp</link>
<description>It's been a few days since I added a song to the Grateful Dead channel. Now that there are all these new Radio users, many of whom are tuned into this channel (it's #16 on the hotlist of upstreaming Radio users, there's...
</description>
<enclosure url="http://www.scripting.com/mp3s/weatherReportDicksPicsVol7.mp3" length="6182912" type="audio/mpeg"/>
<author>dave@userland.com (Dave Winer)</author>
</item>
</channel>
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Plasp/App.pm view on Meta::CPAN
# Setup a hash here holding references to various objects at this
# scope, so that the closures for calling the responder will be
# able to write to this scope.
my %refs = ( responder => shift );
# If a responder is passed in, that means streaming response is
# supported so pass a closure to write out headers and body
if ( $refs{responder} ) {
$_asp->Response->_headers_writer(
sub { $refs{writer} = $refs{responder}->( \@_ ) }
);
lib/Plasp/App.pm view on Meta::CPAN
# client
$refs{writer}->close;
} else {
# If not using streaming response, then save response
# for reference later
$refs{status} = $resp->Status;
$refs{headers} = $resp->Headers;
$refs{body} = [ $resp->Output ];
}
lib/Plasp/App.pm view on Meta::CPAN
? \( @refs{qw(status headers body)} )
: $error_response;
}
};
if ( $_asp->req->env->{'psgi.streaming'} ) {
# Return the callback subroutine if streaming is supported
return $callback;
} else {
# Manually call the callback to get response
return $callback->();
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Pod/POM/Web.pm view on Meta::CPAN
$command .= "(from_scratch=>1)" if $req->parameters->get('from_scratch');
warn "STARTING COMMAND $command\n";
open my $pipe, '-|', qq{perl -Ilib -MPod::POM::Web -e "$command"};
# pipe progress reports from the subprocess into the HTTP response,
# using Plack's streaming API
my $res = Plack::Response->new(200);
$res->content_type('text/plain');
$res->body($pipe);
return $res->finalize;
}
view all matches for this distribution
view release on metacpan or search on metacpan
t/YAML/Tiny.pm view on Meta::CPAN
The YAML Tiny specification does not mandate any particular methodology
or mechanism for parsing.
Any compliant parser is only required to parse a single document at a
time. The ability to support streaming documents is optional and most
likely non-typical.
Because anchors and aliases are not supported, the resulting representation
graph is thus directed but (unlike the main YAML specification) B<acyclic>.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Pod/Webserver.pm view on Meta::CPAN
while( my $conn = $daemon->accept ) {
if( my $req = $conn->get_request ) {
#^^ That used to be a while(... instead of an if( ..., but the
# keepalive wasn't working so great, so let's just leave it for now.
# It's not like our server here is streaming GIFs or anything.
DEBUG and print "Answering connection at ", localtime()."\n";
$self->_serve_thing($conn, $req);
}
$conn->close;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Porbo/Server.pm view on Meta::CPAN
REMOTE_ADDR => $peer_host,
'psgi.version' => [ 1, 0 ],
'psgi.errors' => *STDERR,
'psgi.url_scheme' => $ssl ? 'https' : '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' => undef, # will be set by _run_app()
'psgix.io' => $hdl->fh,
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Prancer/Response.pm view on Meta::CPAN
# the extra array ref brackets around the sub are because Web::Simple,
# which we use as the router, will not do a callback without them. by
# returning an array ref we are telling Web::Simple that we are giving
# it a PSGI response. from the Web::Simple docs:
#
# Well, a sub is a valid PSGI response too (for ultimate streaming
# and async cleverness). If you want to return a PSGI sub you have
# to wrap it into an array ref.
#
return [ sub {
my $responder = shift;
# this idiom here borrows heavily from the documentation on this
# blog post, by tatsuhiko miyagawa:
#
# http://bulknews.typepad.com/blog/2009/10/psgiplack-streaming-is-now-complete.html
#
# this effectively allows the user of this api to stream data to
# the client.
# finalize will always return a three element array. the third
lib/Prancer/Response.pm view on Meta::CPAN
$response->body("hello");
$response->body("goodbye", "world");
If a buffered response is not desired then the body may be a callback to send a
streaming response to the client. Any headers or response codes set in the
callback will be ignored as they must all be set beforehand. Any body set
before a callback is set will also be ignored. For example:
$response->body(sub {
my $writer = shift;
view all matches for this distribution
view release on metacpan or search on metacpan
0.11 2007-05-25
- Added a new message strategy - 'overlay_newline'.
0.12 2007-05-25
- When streaming a msg with \n at the end, no need to bs then.
0.20 2007-06-08
- changing the setMessage API, to enable setting 'delayed' messages
i.e. 'set message on next tick' etc.
view all matches for this distribution
view release on metacpan or search on metacpan
- treat protocol-relative urls as path
1.0.11 25.11.2020
- improve makefile
- change constant names
1.0.10 30.10.2020
- bugfix: chunked data streaming correctly supports compression
- bugfix: gzip uncompression
- multipart/form-data: allow to define filename and content/type
1.0.9 25.06.2020
- $request->method_str now returns stringified effective method
- fix compilation issues on *BSD
view all matches for this distribution
view release on metacpan or search on metacpan
- updated protocol id string ("h2", "h2c"), dropped old interop id strings
0.16 2015-04-05T20:41:49Z
- update status (beta)
- add wiki link
- implemented server streaming
- implemented client downloading, request cancelling
0.15 2015-02-26T20:39:20Z
- Split settings for decoder/encoder
- Allow to setup custom settings in Server/Client constructor
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Protocol/IMAP/Fetch.pm view on Meta::CPAN
If there's a {123} string literal, then we need to stream that amount of data:
we request a new sink, primed with the data we have so far, with the byte count
({123} value) as the limit, and allow it to pass us events until completion.
In streaming mode, we'll pass those to event listeners.
Otherwise, we'll store this data internally to the appropriate key.
then switch back to line mode.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Protocol/OSC.pod view on Meta::CPAN
Reverse of previous.
=head2 to_stream($data)
Packs raw OSC data for (tcp) streaming.
=head2 from_stream($buf)
Returns list of raw OSC data packets in B<$buf> from stream buffer and residue of B<$buf>.
If $buf is incomplete - returns only B<$buf>.
view all matches for this distribution
view release on metacpan or search on metacpan
qtgui/examples/xml/htmlinfo/apache_org.html view on Meta::CPAN
figure represents an increase of more than 40% over the previous year,
demonstrating the rapidly growing interest in Apache and Open Source software
amongst European businesses.
If you have not been able to attend ApacheCon Europe, you can still watch
<a href="http://streaming.linux-magazin.de/en/archive_apachecon08eu.htm">videos of all keynotes and select talks online</a>. Keynote sessions
and the opening plenary are available <b>free of charge</b>:</p>
<ul>
<li><a href="http://streaming.linux-magazin.de/events/apacheconfree/archive/jjagielski/frames-java.htm" onclick="window.open(this.href, '_blank', 'width=1024, height=768'); return false;">State of the Feather</a>
by Jim Jagielski, Chairman of the Apache Software Foundation</li>
<li><a href="http://streaming.linux-magazin.de/events/apacheconfree/archive/cschmidt/frames-java.htm" onclick="window.open(this.href, '_blank', 'width=1024, height=768'); return false;">Using Audio Technology and Open Content to Reduce Global Illiter...
by Cliff Schmidt, Executive Director of Literacy Bridge</li>
<li><a href="http://streaming.linux-magazin.de/events/apacheconfree/archive/rghosh/frames-java.htm" onclick="window.open(this.href, '_blank', 'width=1024, height=768'); return false;">Apache and Steam Engines: the Magic of Collaborative Innovation</a...
by Rishab Aiyer Ghosh, Open Source Initiative Board Member</li>
<li><a href="http://streaming.linux-magazin.de/events/apacheconfree/archive/rfielding/frames-java.htm" onclick="window.open(this.href, '_blank', 'width=1024, height=768'); return false;">Apache 3.0 (a Tall Tale)</a>
by Roy Fielding, Co-founder of The Apache Software Foundation,
and Vice President, Apache HTTP Server</li>
</ul>
<p>The talks of the following select ApacheCon Europe tracks are
available for just 49 Euro:
<a href="http://streaming.linux-magazin.de/en/archive_apachecon08eu.htm#wednesday">System Administration</a>,
<a href="http://streaming.linux-magazin.de/en/archive_apachecon08eu.htm#thursday">Web Security</a>,
<a href="http://streaming.linux-magazin.de/en/archive_apachecon08eu.htm#friday">Web Services and Web 2.0</a>.
</p>
<hr />
</div>
<h4 id="apachecon-us">
view all matches for this distribution