Skip to content

Instantly share code, notes, and snippets.

@jparise
jparise / gist:3428652
Created August 22, 2012 19:39
Tornado Graceful Shutdown
def shutdown(graceful=True):
"""Shut down the application.
If a graceful stop is requested, waits for all of the IO loop's
handlers to finish before shutting down the rest of the process.
We impose a 10 second timeout.
"""
ioloop = tornado.ioloop.IOLoop.instance()
def final_stop():