Le 10 avr. 07 à 17:57, Jimmy Cooksey a écrit :

Hi,

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.

You want ajax here. I designed stuff maintaining an HTTP connexion open for hours, but it was not pretty.

I'd run the task using POE / IPC::Run or Expect and leaving the server process alone. You'd then use Ajax to query the running process.

David Morel



Attachment: PGP.sig
Description: Ceci est une signature électronique PGP

_______________________________________________
List: [email protected]
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[email protected]/
Dev site: http://dev.catalyst.perl.org/

Reply via email to