Hello,
Were are trying to run long a task (DB import) from a HTML::Mason page
and are trying to send an immediate response to the user while the task
is running. Here is our pseudo-code:
%init
sub long_running_task {
# lottsa long, boring stuff
}
On Thu, 25 Jan 2001, Louis-David Mitterrand wrote:
Hello,
Were are trying to run long a task (DB import) from a HTML::Mason page
and are trying to send an immediate response to the user while the task
is running. Here is our pseudo-code:
%init
sub long_running_task {
# lottsa
--- Louis-David Mitterrand [EMAIL PROTECTED] wrote:
Hello,
Were are trying to run long a task (DB import) from a HTML::Mason
page and are trying to send an immediate response to the user while
the task is running. Here is our pseudo-code:
%init
sub long_running_task {
# lottsa
You need $r-flush();
1) Send out header
2) Use $r-print(...) to give some "please be patient" message or something
3) End the first chunk of info with "br\n", so that the browser knows enough
about the page layout to start page output.
4) Use $r-flush();
5) Do your long task
6) Produce rest of
Sorry all, this should have been $r-rflush() - too many r's ... I guess the
additional "r" was meant as a reminder that this is a low-level call, and
flushing buffers results in a performance hit, and should not be done for no
good reason.
- Gerd.
Gerd Kortemeyer wrote:
You need $r-flush();