From: Ben Darnell Date: Wed, 11 Aug 2010 18:34:40 +0000 (-0700) Subject: Add a mention of on_connection_close to the html docs. Add a X-Git-Tag: v1.1.0~38 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=db3d021921fd7f55ccb018f165f634e332646ced;p=thirdparty%2Ftornado.git Add a mention of on_connection_close to the html docs. Add a warning about proxies keeping connections open. --- diff --git a/tornado/web.py b/tornado/web.py index 4c3a8f6ac..daf8b315b 100644 --- a/tornado/web.py +++ b/tornado/web.py @@ -160,6 +160,11 @@ class RequestHandler(object): you try (and fail) to produce some output. The epoll- and kqueue- based implementations should detect closed connections even while the request is idle. + + Proxies may keep a connection open for a time (perhaps + indefinitely) after the client has gone away, so this method + may not be called promptly after the end user closes their + connection. """ pass diff --git a/website/templates/documentation.txt b/website/templates/documentation.txt index 90738bbe0..5d19d6652 100644 --- a/website/templates/documentation.txt +++ b/website/templates/documentation.txt @@ -675,6 +675,9 @@ will be properly closed. For a more advanced asynchronous example, take a look at the `chat` example application, which implements an AJAX chat room using [long polling](http://en.wikipedia.org/wiki/Push_technology#Long_polling). +Users of long polling may want to override `on_connection_close()` to clean +up after the client closes the connection (but see that method's docstring +for caveats). ### Third party authentication