[Twisted-Python] Python multiprocessing and Twisted stopService - success story
tom.sheffler at gmail.com
Wed Jan 18 12:39:41 EST 2012
We are using Py2.6's multiprocessing with Twisted and things are working
nicely. I thought I'd pass on something that seems to work pretty well.
I am using multiprocessing to spawn long-running worker processes as
children of Twisted. When Twisted is killed, I want the children to be
unceremoniously killed as well. I looked into signal handlers, but
creating a service that kills the child processes ended up being simpler
and is working well with twistd daemonization.
for p in multiprocessing.active_children():
and in my main service maker:
s = MultiService()
stopper = MultiprocessingStopService()
Perhaps this will be helpful to someone.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Twisted-Python