Skip to content

Commit

Permalink
better descriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Mar 21, 2015
1 parent f24df04 commit ae1deb1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions lib/Mojo/Content.pm
Expand Up @@ -586,7 +586,7 @@ Write dynamic content non-blocking, the optional drain callback will be invoked
once all data has been written. You can write an empty chunk at any time to end
the stream.
# Start dynamic content, but do not write anything yet
# Finalize response headers and wait for dynamic content
$content->write;
# Make sure previous chunk has been written before continuing
Expand All @@ -609,7 +609,7 @@ Write dynamic content non-blocking with C<chunked> transfer encoding, the
optional drain callback will be invoked once all data has been written. You can
write an empty chunk at any time to end the stream.
# Start dynamic content, but do not write anything yet
# Finalize response headers and wait for dynamic content
$content->write_chunk;
# Make sure previous chunk has been written before continuing
Expand Down
18 changes: 9 additions & 9 deletions lib/Mojolicious/Controller.pm
Expand Up @@ -929,14 +929,14 @@ parameters, so you have to make sure it is not excessively large, there's a
Write dynamic content non-blocking, the optional drain callback will be invoked
once all data has been written.
# Start dynamic content, but do not write anything yet
# Finalize response headers and wait for dynamic content
$c->write;
# Keep connection alive (with Content-Length header)
$c->res->headers->content_length(6);
$c->write('Hel' => sub {
my $c = shift;
$c->write('lo!')
$c->write('lo!');
});
# Close connection when finished (without Content-Length header)
Expand Down Expand Up @@ -984,13 +984,13 @@ defaults to C<15> seconds.
Write dynamic content non-blocking with C<chunked> transfer encoding, the
optional drain callback will be invoked once all data has been written.
# Start dynamic content, but do not write anything yet
# Finalize response headers and wait for dynamic content
$c->write_chunk;
# Make sure previous chunk has been written before continuing
$c->write_chunk('He' => sub {
$c->write_chunk('H' => sub {
my $c = shift;
$c->write_chunk('ll' => sub {
$c->write_chunk('ell' => sub {
my $c = shift;
$c->finish('o!');
});
Expand All @@ -1005,10 +1005,10 @@ stream.
Transfer-Encoding: chunked
Server: Mojolicious (Perl)
2
He
2
ll
1
H
3
ell
2
o!
0
Expand Down

0 comments on commit ae1deb1

Please sign in to comment.