10 Jun
2009
10 Jun
'09
5:18 a.m.
Thomas Jakobsen wrote:
Hi
As discussed in a previous thread
http://twistedmatrix.com/pipermail/twisted-python/2009-May/019717.html
a task put in its own thread via deferToThread() won't stop even though the reactor has stopped. It has to carry out its own check that the reactor is running and stop if that is not the case.
My question is: Is it possible to use anything else than the reactor.running as stop condition in this way? In my current twisted application I would like to keep the reactor running but still have some deferToThread jobs stop if e.g. an exception occurs in one of the jobs.
A threading.Event object? Can you run the jobs as sub-processes? Then you could just kill them.