[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cgiapp] Print without a return from a runmode


Eric wrote:
Hi,


I want to make a progress bar showing time expired and using $|=1 for this statement.

The easiest, and most common way to do this is to post to an interim page that shows the progress bar, and have that page automatically redirect to the real page which can take it's time doing the update. This method doesn't allow the progress bar to show any accurate info about when the process will complete though.

If you want something more complex, start your process in the background, then return a progres bar immediately, and have this progress bar refresh the page every few seconds. On the subsequent requests from the progress bar you can check to see how your long running process is doing and return any pertinent info as you send out another progres bar. Once the process is finished, you can return the success page.

Trying to do all this within one request is just looking for trouble. The above technique will not require any 'messing' with the way CGI::Application works.

For a complete example of how to do this see Merlyn's article on this topic:

http://www.stonehenge.com/merlyn/LinuxMag/col39.html

Another example that uses this type of progress bar by reloading a page and checking for a long running process is the Apache::UploadMeter module. It provides a progress bar for uploading large files. It won't work directly for you, but may give some insight.

Cheers,

Cees




my $approved = $processcard->PostCard($formdata);

So I have two problems, is there a way to treat this statement as if I was polling something and do a print to stdout on a regular interval, and can I do the print in the first place from within a runmode?


What I want to end up with is something that works like this,

print "PROCESSING<font size=22>";

until exists($approved){

        print " . ";
        sleep 1;
}


What I am a little afraid of is that I won't be able to do this at all because what I am really wanting ends up having to be a multi threaded application.

Thanks,

Eric




Lead Programmer
D.M. Contact Management
250.383.0836 ext 229

---------------------------------------------------------------------
Web Archive:  http://www.mail-archive.com/suppressed/
              http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: suppressed
For additional commands, e-mail: suppressed





---------------------------------------------------------------------
Web Archive:  http://www.mail-archive.com/suppressed/
             http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: suppressed
For additional commands, e-mail: suppressed


Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.