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

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

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

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

2009-05-29 Thread Jean-Paul Calderone
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: >

[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