[Twisted-Python] stop conditions and deferToThread()
p.mayers at imperial.ac.uk
Wed Jun 10 06:18:30 EDT 2009
Thomas Jakobsen wrote:
> As discussed in a previous thread
> 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
A threading.Event object?
Can you run the jobs as sub-processes? Then you could just kill them.
More information about the Twisted-Python