[Twisted-Python] Application Start Up and Tear Down

Adam Atlas adam at atlas.st
Mon Jul 9 01:07:01 EDT 2007

On 9 Jul 2007, at 00.49, Pavel Bastov wrote:
> so far I've been using only one Factory in my application. So, all the
> intialization and deinitialization code was in startFactory() /
> stopFactory().
> Now I have to add another protocol with another factory. Is there a
> similar pair of methods for the application (server) where I can
> initialize resources (db pool, for example) upon startup and free them
> upon shutdown?

Wouldn't it work to simply handle your initialization and cleanup  
before and after reactor.run()?

More information about the Twisted-Python mailing list