2009/5/26 Adam Dziendziel <[email protected]>: > > Hi, > > I have some long running requests which I would like to make > asynchronous: queue in database and run when the server is idle or not > very busy. > > I was thinking about scheduling a cron job that would be executed > every 10 seconds or so which would issue a request to execute a job > from the queue if the current server load is low. > > How to check load of a Pylons application? Maybe it is possible to > access Paste's thread pool and calculate how many threads are idle. > Does anybody know how to do it?
Paste ist not asynchronous, and keeping queue control in web application is bad solution. You can try this: - load a task to database - web application will redirect to a checking location, where will be current status of this task - run a controller process which wolud check periodically for new tasks - if there is a new task, controller will spawn a worker for it - worker will do the task and update task record in database - checking location will inform that task is done Best regards, Cezary Statkiewicz -- Cezary Statkiewicz - http://thelirium.net rlu#280280 gg#5223219 jabber://[email protected] --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "pylons-discuss" 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/pylons-discuss?hl=en -~----------~----~----~----~------~----~------~--~---
