Skip to content

Commit

Permalink
a few more examples
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Mar 21, 2015
1 parent e42600f commit f24df04
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions lib/Mojo/Content.pm
Expand Up @@ -589,6 +589,15 @@ the stream.
# Start dynamic content, but do not write anything yet
$content->write;
# Make sure previous chunk has been written before continuing
$content->write('He' => sub {
my $content = shift;
$content->write('llo!' => sub {
my $content = shift;
$content->write('');
});
});
=head2 write_chunk
$content = $content->write_chunk;
Expand All @@ -603,6 +612,15 @@ write an empty chunk at any time to end the stream.
# Start dynamic content, but do not write anything yet
$content->write_chunk;
# Make sure previous chunk has been written before continuing
$content->write_chunk('He' => sub {
my $content = shift;
$content->write_chunk('llo!' => sub {
my $content = shift;
$content->write_chunk('');
});
});
=head1 SEE ALSO
L<Mojolicious>, L<Mojolicious::Guides>, L<http://mojolicio.us>.
Expand Down

0 comments on commit f24df04

Please sign in to comment.