[Twisted-Python] What is the difference in between reactor.running and reactor._stopped

exarkun at twistedmatrix.com exarkun at twistedmatrix.com
Fri Sep 18 12:21:17 EDT 2009

On 02:23 pm, gabriel.rossetti at arimaz.com wrote:
>I tried using reactor.running for a test, to not try to stop the 
>if it's already stopped, but it doesn't work. If I use reactor._stopped
>instead, it works. I know I'm not supposed to access it sonce it is
>prefixed by the underscore, so my question is what is the difference in
>between reactor.running and reactor._stopped, and why does
>reactor.running not work as I expect (not reactor.running ==

reactor.running is really only provided for backwards compatibility.  It 
was never intended to be public.  It has bizarre semantics which you can 
read about in its unit tests:


What you would almost certainly rather do is change your code not to 
rely on it.  Why do you find yourself needing to ask the reactor if you 
have previously asked it to stop?  Generally, your code should be able 
to keep track of that itself.


More information about the Twisted-Python mailing list