FW: (busy) function call causes browser timeout

I thought I had my head around this but, I do not…I am calling clone( ) in
rt/lib/RT/Ticket_Overlay.pm from the <%INIT> mason block in Display.html. Is
clone( ) where I put a callback to the browser? To reiterate, the clone( )
in the.pm http://the.pm file has the loop that currently has to complete
before the server responds to the browser request.

Thank you for your help!

RyanOn 9/23/05, Ryan von Gleich VonGleichR@lanusa.com wrote:

-----Original Message-----
From: Todd Chapman [mailto:todd@chaka.net]
Sent: Thursday, September 22, 2005 3:25 PM
To: Ryan von Gleich
Cc: rt-users@lists.bestpractical.com
Subject: Re: [rt-users] (busy) function call causes browser timeout

On Thu, Sep 22, 2005 at 03:25:58PM -0400, Ryan von Gleich wrote:

There are times where 100 or more tickets will have to be created, I
have a feeling I can never make it that fast. I research how to spit
Mason output and flushing the buffer, sounds like the right direction.
Thank you.

Ryan

Here’s part of the answer: $m->flush_buffer();

I thought I had my head around this but, I do not…I am calling clone( ) in
rt/lib/RT/Ticket_Overlay.pm from the <%INIT> mason block in Display.html. Is
clone( ) where I put a callback to the browser? To reiterate, the clone( )
in the.pm http://the.pm file has the loop that currently has to complete
before the server responds to the browser request.

Thank you for your help!

Ryan

I assume that your init block has a loop that calls clone the number
of necessary times. If that is not so, you need to refactor clone
so that you can call it once for each needed clone. As long as
each individual call to clone is less time than the browser timeout
you will be able to send output to the browser (from the init block)
to keep it happy.

You can’t send output from the pm file to the browser. Well, you
could, but then your backend API would not be separated from your
interface.

-Todd

I assume that your init block has a loop that calls clone the number

of necessary times. If that is not so, you need to refactor clone
so that you can call it once for each needed clone. As long as
each individual call to clone is less time than the browser timeout
you will be able to send output to the browser (from the init block)
to keep it happy.

I know this is not crucial, but is there anyway to do away with the stuff
that is sent to the browser so that it is gone when the before function call
is completes and sends the new page?
Thanks Ryan

You don’t have to send stuff that displays. You can send HTML
comments or maybe just whitespace. You might also be able to
do some DHTML slight of hand, but I don’t know how to do it.

Another option is to do the processing in the background and
return a reult page that refreshes every few seconds with a
status and finally returns the results when everything is
finished.

-ToddOn Mon, Sep 26, 2005 at 01:30:32PM -0400, Ryan von Gleich wrote:

I assume that your init block has a loop that calls clone the number

of necessary times. If that is not so, you need to refactor clone
so that you can call it once for each needed clone. As long as
each individual call to clone is less time than the browser timeout
you will be able to send output to the browser (from the init block)
to keep it happy.

I know this is not crucial, but is there anyway to do away with the stuff
that is sent to the browser so that it is gone when the before function call
is completes and sends the new page?
Thanks Ryan