mozilla-services/chaussette — pull request #51 by grantcox (2014-03-02 19:04:10+00:00)
Title: Adding --graceful_timeout argument

I recently created an issue for adding "graceful shutdown" options to chaussette - so that when shutting down a backend will stop receiving new connections immediately, but wait some period for existing connections to complete.
https://github.com/mozilla-services/chaussette/issues/50

This pull request implements this feature for the gevent and geventwebsockets backends. I'm not familiar with the other backends, so I've left them out for now.

Please note the change to moving the gevent monkey patching to immediately after the import. Without this I was getting a "Exception KeyError in module threading" on shutdown, indicating that the system threading module was used before gevent could patch it.