On 8/5/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > I am designing a web page with Web.py and since I don't have that much > experience in Web programming I am writing to the list to ask for > advice. > > My question if about what is the best thing to do when some job > submitted to Web.py will take a ver long time. In my case, what I am > working on is uploading large files then processing within Python and > storing them in SQLite. The processing part is what really takes long, > possible up to an hour. One option I had been thinking about just > forking the process, the parent goes on to report to the user that > file was received correctly, while the child goes to perform the > processing in the background. Since, this is not going to be done very > frequently, I've thought also about disabling access to the website > will the database is updated. > > My question is. Is there a more elegant way to handle this? Using a > 3rd party solution? Or within Web.py?
I'm not sure of the web.py behavior, but what you're needing sounds sort of like the 'register_shutdown_function' in PHP. That is, once all activity is sent to the browser and the script goes into shutdown, then process these functions. It is very useful for housecleaning activities; one of mine is to auto-generate PmWiki pages based on day of week/author. This helps the site remain responsive. I'm not sure if there is a web.py analog. -- Ben Wilson "Words are the only thing which will last forever" Churchill --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "web.py" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/webpy?hl=en -~----------~----~----~----~------~----~------~--~---
