From: Ben Darnell Date: Sun, 22 Apr 2018 03:44:50 +0000 (-0400) Subject: iostream: Document the non-deprecation of set_close_callback X-Git-Tag: v5.1.0b1~23^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=19155ff888eb4752aadf1ff6b4e0432413c97693;p=thirdparty%2Ftornado.git iostream: Document the non-deprecation of set_close_callback --- diff --git a/tornado/iostream.py b/tornado/iostream.py index 9f8fdf257..c28dacfba 100644 --- a/tornado/iostream.py +++ b/tornado/iostream.py @@ -593,9 +593,14 @@ class BaseIOStream(object): def set_close_callback(self, callback): """Call the given callback when the stream is closed. - This is not necessary for applications that use the `.Future` - interface; all outstanding ``Futures`` will resolve with a - `StreamClosedError` when the stream is closed. + This mostly is not necessary for applications that use the + `.Future` interface; all outstanding ``Futures`` will resolve + with a `StreamClosedError` when the stream is closed. However, + it is still useful as a way to signal that the stream has been + closed while no other read or write is in progress. + + Unlike other callback-based interfaces, ``set_close_callback`` + will not be removed in Tornado 6.0. """ self._close_callback = stack_context.wrap(callback) self._maybe_add_error_listener()