[Web-SIG] A 'shutdown' function in WSGI

Tarek Ziadé ziade.tarek at gmail.com
Mon Feb 20 20:30:20 CET 2012


oops my examples were broken, should be:

def hello_world_app(environ, start_response):
    status = '200 OK' # HTTP Status
    headers = [('Content-type', 'text/plain')]
    start_response(status, headers)
    return ["Hello World"]
def shutdown():   # or maybe something else as an argument I don't know
   do_some_cleanup()


and:

$ gunicorn myapp:hello_world_app myapp:shutdown



Cheers
Tarek
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/web-sig/attachments/20120220/e2268422/attachment.html>


More information about the Web-SIG mailing list