On Wed, Aug 22, 2012 at 11:03 AM, Calvin <calvin...@gmail.com
> Hi all,
> I have a PeriodicCallback that makes HTTP requests to an external API via
> SimpleAsyncHTTPClient. Whenever a request is made, it's important to record
> the response in the datatabase; missing a response is bad.
> Whenever I shut down the Tornado server, I run the risk of doing so in the
> middle of a request, which would cause my application to miss recording a
> response. Is there a way to gracefully shut down Tornado, but block if the
> PeriodicCallback is currently running?
I use a graceful shutdown process in my application. It blocks for up
to 10 seconds while it waits for IO loop handlers to complete.
Here's the code: https://gist.github.com/3428652