[Twisted-Python] reactor.stop() and deferToThead

2009-05-29 Thread Thomas Jakobsen
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

Re: [Twisted-Python] reactor.stop() and deferToThead

2009-05-29 Thread Thomas Jakobsen
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

[Twisted-Python] stop conditions and deferToThread()

2009-06-10 Thread Thomas Jakobsen
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()

Re: [Twisted-Python] stop conditions and deferToThread()

2009-06-12 Thread Thomas Jakobsen
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