[Catalyst] streaming output to view in real time

Jimmy Cooksey jcooksey at gmail.com
Tue Apr 10 16:57:17 GMT 2007


I'm looking for a way to redirect STDOUT from an external application
directly into my website, updating in real time.

My original plan is to do something like this:

1.  Controller popen's some program
2.  Reads the file descriptor
3.  Redirects each new line into some DIV in my view, showing each new
line in real time.

This controller would be called after a form submit.

#3 is the part I don't know how to do, or if it's even possible.  I
haven't seen a $c->res method that lets me update directly into a DIV,
which I was kind of banking on.  The "real time" part is pretty
imperative also.  I can't get away with waiting for the program to
execute, then dumping all of it's output at once.

Any general guidance is greatly appreciated.


More information about the Catalyst mailing list