[Python-Dev] [Twisted-Python] Newbie question

James Y Knight foom at fuhm.net
Thu Sep 7 15:01:08 EDT 2006


On Sep 7, 2006, at 2:25 PM, Jean-Paul Calderone wrote:

>> Let me rephrase. Are there any technical reasons preventing
>> reactor.run() from throwing if started twice? Is there any reason
>> *not* to make this throw an exception?
>
> Not really.

It could also work. What's preventing it is that the shutdown  
triggers are cleared when the reactor stops, and some of the triggers  
are essential for the shutdown process, so the second time, it  
doesn't ever finish shutting down.

However, even though it'd be possible to fix, perhaps it is better to  
simply throw an exception on the second reactor.run(), since most  
people who do that shouldn't actually be running the reactor twice,  
they just didn't know the better thing to do yet.

James




More information about the Twisted-Python mailing list