Catalyst-Runtime
    
    
  
  
  
view release on metacpan or search on metacpan
lib/Catalyst/UTF8.pod view on Meta::CPAN
        $writer->write_encoded('<p>This is stream_write_fh action â¥</p>');
        $writer->close;
    }
This can be used just like the C<write> method, but typically you request this object when
you want to do a nonblocking style response since the writer object can be closed over or
sent to a model that will invoke it in a non blocking manner.  For more on using the writer
object for non blocking responses you should review the C<Catalyst> documentation and also
you can look at several articles from last years advent, in particular:
L<http://catalyst.perl.org/calendar/2013/10>, L<http://catalyst.perl.org/calendar/2013/11>,
L<http://catalyst.perl.org/calendar/2013/12>, L<http://catalyst.perl.org/calendar/2013/13>,
L<http://catalyst.perl.org/calendar/2013/14>.
The main difference this year is that previously calling ->write_fh would return the actual
L<Plack> writer object that was supplied by your Plack application handler, whereas now we wrap
that object in a lightweight decorator object that proxies the C<write> and C<close> methods
and supplies an additional C<write_encoded> method.  C<write_encoded> does the exact same thing
as C<write> except that it will first encode the string when necessary.  In general if you are
streaming encodable content such as HTML this is the method to use.  If you are streaming
binary content, you should just use the C<write> method (although if the content type is set
correctly we would skip encoding anyway, but you may as well avoid the extra noop overhead).
( run in 0.369 second using v1.01-cache-2.11-cpan-5dc5da66d9d )