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

gx1986 at mail.ustc.edu.cn gx1986 at mail.ustc.edu.cn
Fri Sep 18 13:02:38 EDT 2009


Thank you for your instruct! I am a new people in twisted,so I still have another problem.
If i transfer a lot of data(a big file),program will hang when transmission finished.
If transfering a few words ,program will give me another chance to input.
what's the reason about this?

> -----Original E-mail-----
> From: exarkun at twistedmatrix.com
> Sent Time: 2009-9-19 0:21:17
> To: "Twisted general discussion" <twisted-python at twistedmatrix.com>
> Cc: 
> Subject: Re: [Twisted-Python] What is the difference in
	between	reactor.running and reactor._stopped
> 
> On 02:23 pm, gabriel.rossetti at arimaz.com wrote:
> >Hello,
> >
> >I tried using reactor.running for a test, to not try to stop the 
> >reactor
> >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._stopped)?
> 
> 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:
> 
> http://twistedmatrix.com/trac/browser/trunk/twisted/internet/test/test_core.py
> 
> 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.
> 
> Jean-Paul
> 
> _______________________________________________
> Twisted-Python mailing list
> Twisted-Python at twistedmatrix.com
> http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python




More information about the Twisted-Python mailing list