[Twisted-web] Capturing a web-server shutdown signal?

James Y Knight foom at fuhm.net
Sat Jul 31 14:48:49 MDT 2004

On Jul 31, 2004, at 11:13 AM, Sergio Trejo wrote:
> When a Twisted web server is killed, I'd like to somehow get a signal 
> from the server that its going down and clean up some objects (I.e., a 
> PB Client instance -- need to log it out of the PB Server on shutdown) 
> that I've persisted in the web server's registry. Has anyone done this 
> before? Any suggestions besides perhaps usng the shutdown script to 
> instantiate an HTTP client which fires a URL to the server which acts 
> as a trigger to handle the registry cleanup?

reactor.addSystemEventTrigger('before', 'shutdown', yourfunction)

More information about the Twisted-web mailing list