The basic concept of the scheduler is to have a process (or multiple ones) 
NOT managed by the webserver, that are ready to do some work when told to 
do so.
Why ? 99% of the cases is composed by:
- long-running computations that will incur in the webserver dropping the 
process for timeout
- async processing of a task to make the webapp feel "snappier" while 
providing the same functionality

Starting an external process from a "web-served" process is a contradiction 
in terms: we don't want zombie processes and as soon as the webserver kills 
the "originator", the worker would be terminated too.
Another good reason to not provide that functionality is that one may want 
to run the task on a totally different server than the "web-serving" one 
(decoupling).
This is on top of the fact that managing long-running processes is best 
done by softwares specifically engineered to do so, and highly 
platform-dependant.
Given that starting those processes (and restart them if they die, etc etc 
etc) is fairly easy to set up with what the underlying OS provides, and 
that most of them are covered in the book, it shouldn't be hard to set up a 
scheduler.

That being said, the "scheduler architecture" relies on a never-ending 
process that loops over inifitely searching for tasks to be executed, 
sleeping when no tasks are ready to be processed. Every process is in 
charge of executing one task at a time, and the same task can't be executed 
at the same time by another worker.
In your case it translates to starting one - or a few - scheduler processes 
and to queue tasks from your application. As soon as a worker is ready to 
process those, they'll get picked up and executed. 


-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to