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

glyph at divmod.com glyph at divmod.com
Thu Sep 7 15:32:41 EDT 2006

On Thu, 7 Sep 2006 15:01:08 -0400, James Y Knight <foom at fuhm.net> wrote:

>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.

I think that's a good idea.  Based on the nature of the questions that I've seen, I think that this would probably be a good idea even if we *did* have a restartable reactor.  Add an interface, IRestartableReactor, and require people who want to use it to call 'reactor.restart()'.  While this might not actually *do* anything, the conspicuous absence of it from any example code and a potentially useful error message from reactor.run would prevent the question from being asked repeatedly...

More information about the Twisted-Python mailing list