On Sun, Apr 15, 2012 at 8:08 AM, Rita Morgan <rmorgan
...@gmail.com> wrote:
> Hi,
> My web application involves many subprocesses to get data back to the
> website. I was wondering, if there was a best practices guide or even
> better some examples on how to handle this use case?
As Daniel said, the exact right solution depends on your needs. I
wrote a CherryPy bus plugin to spawn off subprocesses for a commerical
project that worked well enough for long-running daemon processes that
needed to start and stop with my Python application. It was similar
in nature to the BackgroundTask plugin that exists in the standard
distribution, but starts processes instead.
The one tip I can provide is make sure that you spawn your processes
before the threads start, or you may run into some trouble. This
means either using a bus plugin or spawing them before starting the
CherryPy engine.
I'll also note that we were eventually planning to move to Celery to
gain distributed processing support.
Adam