Re: A 'shutdown' function in WSGI

Tarek Ziadé <[email protected]> Mon, 20 Feb 2012 20:30:20 +0100
Newsgroups gmane.comp.python.web
Message-ID <CAGSi+Q5M-oSzPwD5vkHMEwOYw9v1d_82O65fbQLCtK0HonSKQw@mail.gmail.com>
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

_______________________________________________
Web-SIG mailing list
[email protected]
Web SIG: http://www.python.org/sigs/web-sig
Unsubscribe: http://mail.python.org/mailman/options/web-sig/gcpw-web-sig%40m.gmane.org