It was discussed in 

http://www.mail-archive.com/[EMAIL PROTECTED]/msg01851.html

which has a link to a lengthy article with sample code.  The lengthy article says the 
forked child would update a session cache and the parent would continuously check the 
cache to see if the child completed. Wouldn't it be more straightforward for the 
parent to perform a "waitpid"? When the child exits and the parent receives notice of 
this event (via waitpid), it could proceed to check the session cache for more 
detailed information about the final disposition of that process.

Mark


-----Original Message-----
From: Michael Peters <[EMAIL PROTECTED]>
Sent: Aug 3, 2004 6:47 AM
To: cgiapp <[EMAIL PROTECTED]>
Subject: Re: [cgiapp] how to do a progress bar or similar?

Andreas Schuldei wrote:
> hi!
> 
> how can i implement some kind of progress indicator?
> 
> in one part of my app it is hard to tell for the user on the
> remote webbrowser that something is happening and everything goes
> according to plan (during account mass-generation).
> 
> how can i print out the processed usernames or just dots or some
> other nice "we are getting there" indicator?
> 
> I feel this is a bit against  CGI::Applications basic way of
> operation, since it usually outputs the *finished* page.
> 
> How do i do this cleanly and well integrated into the framework?
> anyone with some example code?

Believe it or not, this is a question that is brought up many times 
here. Since I might not remember all of the good suggestions, you might 
want to search the archives.

Briefly, it involves taking the data to be processed, forking off a 
child to actually do the processing (or having a cron job/daemon doing 
the processing). Then you return a 'please wait' screen to the user 
maybe with an animated gif progress bar. This please wait screen will 
continually refresh. When the work being done in the background is 
finished, you can have it set some sort of flag/file, etc telling the 
'please wait' page that is refreshing that it's done, so the next time 
it refreshes it shows the user what they want.

Or you could have the page returned to the user tell them that the 
results will be emailed to them (sometimes this is more 
appropriate/necessary if the processing takes several minutes or more).

HTH

Michael Peters
Developer
Plus Three

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



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

Reply via email to