X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FEngine.pm;h=e63da832612301a21f18d14c9f0547e65b622b53;hb=4e6e0ab2246dc09edb7e2731547931fa28021829;hp=2367139764d3430572bbc79c727bc2091566ba0e;hpb=0eb98ebd1624e8181a4bd88c26605f2a0f1c91d7;p=catagits%2FCatalyst-Runtime.git diff --git a/lib/Catalyst/Engine.pm b/lib/Catalyst/Engine.pm index 2367139..e63da83 100644 --- a/lib/Catalyst/Engine.pm +++ b/lib/Catalyst/Engine.pm @@ -54,12 +54,20 @@ See L. =head2 $self->finalize_body($c) -Finalize body. Prints the response output. +Finalize body. Prints the response output as blocking stream if it looks like +a filehandle, otherwise write it out all in one go. If there is no body in +the response, we assume you are handling it 'manually', such as for nonblocking +style or asynchronous streaming responses. You do this by calling L<\write> +several times (which sends HTTP headers if needed) or you close over C<$response->write_fh>. + +See L and L for more. =cut sub finalize_body { my ( $self, $c ) = @_; + return if $c->response->has_write_fh; + my $body = $c->response->body; no warnings 'uninitialized'; if ( blessed($body) && $body->can('read') or ref($body) eq 'GLOB' ) {