FAQ
I'm "running" a test script from a browser and I need it to provide
feedback as it's running but right now if I run it through catalyst it
wont send text until the process is done. Is there a way to send stuff as
it's running, like forcing the server to send info every so often?

Search Discussions

  • Jonathan Rockway at Aug 30, 2006 at 1:10 am

    Is there a way to send stuff as
    it's running, like forcing the server to send info every so often?
    Nope, everything is printed in a big print statement in finalize().
    (Actually, it's not that big... it's only one line. But you know what I
    mean.) If you think about it, this is necessary because you can change
    headers or the body at any time in the request cycle... and you can't
    unsend data.

    However, nothing is stopping you from printing to {*STDERR}, using
    "warn", or running myapp_server.pl under perl's debugger. Printing
    debugging information to the browser is completely unnecessary.

    Regards,
    Jonathan Rockway
  • Aristotle Pagaltzis at Aug 30, 2006 at 1:51 am

    * Jonathan Rockway [2006-08-30 03:20]:
    If you think about it, this is necessary because you can change
    headers or the body at any time in the request cycle... and you
    can't unsend data.
    So what?s `finalize_headers` do?

    Regards,
    --
    Aristotle Pagaltzis // <http://plasmasturm.org/>
  • Jonathan Rockway at Aug 30, 2006 at 3:51 am
    Fair enough. I'm technically incorrect, but my answer holds.
    finalize_headers and finalize_body both get called after the last end
    action. (I know this experimentally because I mess with the headers in
    my Root.pm/end :)
    * Jonathan Rockway [2006-08-30 03:20]:
    If you think about it, this is necessary because you can change
    headers or the body at any time in the request cycle... and you
    can't unsend data.
    So what?s `finalize_headers` do?
  • Peter Edwards at Aug 30, 2006 at 5:30 am

    Is there a way to send stuff as
    it's running, like forcing the server to send info every so often?
    Good question, not sure how you'd do it with Catalyst.
    I've done this before to show output from a lengthy batch program, using
    CGI.pm, sending the header then the start of the output followed by a
    flushed space char every minute to stop the browser timing out. Like a "tail
    -f" on a log file.

    Regards, Peter
  • Bogdan Lucaciu at Aug 30, 2006 at 7:27 am

    On Tue, 2006-08-29 at 13:32 -0500, Ryan wrote:
    I'm "running" a test script from a browser and I need it to provide
    feedback as it's running but right now if I run it through catalyst it
    wont send text until the process is done. Is there a way to send stuff as
    it's running, like forcing the server to send info every so often?
    check this thread.
    http://lists.rawmode.org/pipermail/catalyst/2006-June/008315.html

    --
    Bogdan Lucaciu <bogdan at wiz.ro>

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupcatalyst @
categoriescatalyst, perl
postedAug 29, '06 at 6:32p
activeAug 30, '06 at 7:27a
posts6
users5
websitecatalystframework.org
irc#catalyst

People

Translate

site design / logo © 2022 Grokbase