]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
http1connection: Un-deprecate set_close_callback
authorBen Darnell <ben@bendarnell.com>
Sat, 21 Apr 2018 20:46:49 +0000 (16:46 -0400)
committerBen Darnell <ben@bendarnell.com>
Sat, 21 Apr 2018 21:11:10 +0000 (17:11 -0400)
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)

tornado/http1connection.py

index 0349e171add5dabe6f2aee21c38ec98e52870840..1c5eadf84c41ec0a42e9fd5bd48c9cec212c6d3b 100644 (file)
@@ -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)