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
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
ads import deferToThread
running = True
def foo():
while running:
print "working"
time.sleep(1)
def bar():
time.sleep(3)
print "stopping"
running = False
d1 = deferToThread(foo)
d2 = deferToThread(bar)
reactor.run()
Thanks for the replies.
In my particular case, adding a
global running
as Tim Allen pointed out, actually did it.
Regards,
Thomas
___
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/tw