From: Ben Darnell Date: Sat, 21 Apr 2018 20:46:49 +0000 (-0400) Subject: http1connection: Un-deprecate set_close_callback X-Git-Tag: v5.1.0b1~24^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=eef32e2544355d3198f8c8c59b714d7d2de3cb7f;p=thirdparty%2Ftornado.git http1connection: Un-deprecate set_close_callback This method is not actually redundant with HTTPMessageDelegate.on_connection_close (maybe there is a useful refactoring that would make it so, but for now it's still useful) --- diff --git a/tornado/http1connection.py b/tornado/http1connection.py index 0349e171a..1c5eadf84 100644 --- a/tornado/http1connection.py +++ b/tornado/http1connection.py @@ -277,8 +277,14 @@ class HTTP1Connection(httputil.HTTPConnection): def set_close_callback(self, callback): """Sets a callback that will be run when the connection is closed. - .. deprecated:: 4.0 - Use `.HTTPMessageDelegate.on_connection_close` instead. + Note that this callback is slightly different from + `.HTTPMessageDelegate.on_connection_close`: The + `.HTTPMessageDelegate` method is called when the connection is + closed while recieving a message. This callback is used when + there is not an active delegate (for example, on the server + side this callback is used if the client closes the connection + after sending its request but before receiving all the + response. """ self._close_callback = stack_context.wrap(callback)