Skip to content

Commit

Permalink
more detailed streaming recipes
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Jun 15, 2013
1 parent ac9b0b2 commit e2aaff2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
10 changes: 5 additions & 5 deletions lib/Mojolicious/Guides/Cookbook.pod
Expand Up @@ -550,11 +550,11 @@ L<Test::Mojo> API to be used.

=head2 EventSource web service

EventSource is a special form of long-polling where you can directly send DOM
events from servers to clients. It is uni-directional, that means you will
have to use Ajax requests for sending data from clients to servers, the
advantage however is low infrastructure requirements, since it reuses the HTTP
protocol for transport.
EventSource is a special form of long-polling where you can use
L<Mojolicious::Controller/"write"> to directly send DOM events from servers to
clients. It is uni-directional, that means you will have to use Ajax requests
for sending data from clients to servers, the advantage however is low
infrastructure requirements, since it reuses the HTTP protocol for transport.

use Mojolicious::Lite;
use Mojo::IOLoop;
Expand Down
8 changes: 4 additions & 4 deletions lib/Mojolicious/Guides/Rendering.pod
Expand Up @@ -842,10 +842,10 @@ C<after_render>.
=head2 Chunked transfer encoding

For very dynamic content you might not know the response content length in
advance, that's where the C<chunked> transfer encoding comes in handy. A
common use would be to send the C<head> section of an HTML document to the
browser in advance and speed up preloading of referenced images and
stylesheets.
advance, that's where L<Mojolicious::Controller/"write_chunk"> and the
C<chunked> transfer encoding comes in handy. A common use would be to send the
C<head> section of an HTML document to the browser in advance and speed up
preloading of referenced images and stylesheets.

$self->write_chunk('<html><head><title>Example</title></head>' => sub {
my $self = shift;
Expand Down

0 comments on commit e2aaff2

Please sign in to comment.