[Twisted-Python] Re: reactor.stop

Jp Calderone exarkun at divmod.com
Tue Aug 17 01:21:56 MDT 2004


Eugene Coetzee wrote:
> Christopher Armstrong wrote:
> 
>> On Mon, 16 Aug 2004 11:39:11 +0800, Tsai Li Ming 
>> <mailinglist at ltsai.com> wrote:
>>  
>>
>>> The part that I don't understand is when I import the reactor in my own
>>> py files, why will it be the same single reactor that the application
>>> uses. Is it something special that twisted is handling or is just a
>>> simple python question?
>>>   
>>
>>
>> Well, the reactor module is pretty weird and magical, but in this
>> regard, it acts exactly like any python module. When you import any
>> module twice, you get the same module.
>>
>>  
>>
> In fact - reactor is not an package - but a global instance returned by 
> class SelectReactor.

   This is an implementation detail that should neither affect your 
programs nor be relied upon by them.  In the future, it may be a module 
or some other kind of object.

   Jp




More information about the Twisted-Python mailing list