[mod_python] Child shutdowns?

Barry Warsaw barry at python.org
Fri Aug 29 18:05:31 EST 2003


On Fri, 2003-08-29 at 17:47, Barry Warsaw wrote:

> Thanks Grisha, both for the info and the offer to poke around.  I'll try
> pushing my startup code into my request handler, and see if registering
> my cleanup code at that time will work.

Very quick testing reveals that something like this stanza does the
trick:

def handler(req):
    global _started
    if not _started:
        startup()
        req.server.register_cleanup(req, shutdown)
        _started = True

A bit gnarly perhaps, but palatable.

-Barry




More information about the Mod_python mailing list