Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Status Update type output for Perl web application?

by WizardOfUz (Friar)
on Jan 03, 2010 at 09:38 UTC ( [id://815406]=note: print w/replies, xml ) Need Help??


in reply to Status Update type output for Perl web application?

You can use the chunked transfer encoding to write sequentially to the client. Browsers (usually) parse and display the sent data immediately after the first chunk is read.

Update: mod_perl example

package My::Stream; use strict; use warnings; use Apache2::RequestRec (); use Apache2::RequestIO (); use Apache2::Const -compile => qw( OK ); sub handler :method { my $invocant = shift; my $request_record = shift; $request_record->content_type( 'text/html' ); for ( 1 .. 10 ) { $request_record->print( "<p>$_</p>" ); $request_record->rflush; sleep 1; } return Apache2::Const::OK; } 1;

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://815406]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (4)
As of 2024-04-25 17:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found