[Twisted-Python] Handle Control-C

Jp Calderone exarkun at divmod.com
Wed May 25 07:48:57 EDT 2005


On Wed, 25 May 2005 12:29:42 +0200, Johannes Beigel <johannes.beigel at brainbot.com> wrote:
>Is there a (preferred) way to handle breaks with Control-C?
>
>I'm aware of reactor.addSystemEventTrigger("before", "shutdown",...),
>but I'd like to do some stuff with a fully running reactor and then call
>reactor.stop() manually after some Deferreds come back.

Your before shutdown trigger can return a Deferred.  The reactor won't go away until after the Deferred fires.

Jp




More information about the Twisted-Python mailing list