Thanks for the quick answers! Explicitly making stuff2() return as
soon as it discovers that the reactor has stopped solves the problem.
Regards,
Thomas
___
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
http://twistedmatrix.com/cgi-bin/ma
Python seems to intentionally make aborting threads nigh impossible. You're
probably way better off doing something akin to this:
def stuff2():
time.sleep(4)
if reactor.running:
print "stuff2 finished"
else:
print "Don't need to stuff2"
Also ii
On Fri, 29 May 2009 14:22:43 +0200, Thomas Jakobsen
wrote:
>Hi
>
>It seems that things being deferredToThread continue to run even
>though reactor.stop() is called.
Threads cannot be interrupted. They will run until they function they are
running returns.
>
>Output from the example below is:
>
Hi
It seems that things being deferredToThread continue to run even
though reactor.stop() is called.
Output from the example below is:
stuff1 finished; stopping reactor
stuff2 finished
Is there a way to abort the remaining execution of stuff2 in this
case? It would be handy if, say, some except