[Twisted-Python] Need Exception that will stop ther reactor within twistd

glyph at divmod.com glyph at divmod.com
Fri Nov 24 18:18:21 EST 2006


On 05:14 pm, ncesar at lunix.com.ar wrote:
>I have the following code,

>I want my GoodByeException to exit the reactor loop (basacally do a
>reactor.stop()) and then twistd exit the reactor's main loop. I'm programming
>a bigger application and sudentlly some exceptions are really Fatal, but the
>applications keeps on running (sometimes with no services attending).

So make GoodByeException.__init__ call reactor.stop() instead of setting the useless 'args' attribute.

This is bad form, however.  Particular types of exception should not stop the reactor.  Code that wants the reactor to stop, should call reactor.stop.  Maybe you could make a method that both calls reactor.stop() *and* raises an exception.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://twistedmatrix.com/pipermail/twisted-python/attachments/20061124/1882f18f/attachment.htm 


More information about the Twisted-Python mailing list