MCPcopy Create free account
hub / github.com/EasyIME/PIME / set_close_callback

Method set_close_callback

python/python3/tornado/http1connection.py:317–329  ·  view source on GitHub ↗

Sets a callback that will be run when the connection is closed. Note that this callback is slightly different from `.HTTPMessageDelegate.on_connection_close`: The `.HTTPMessageDelegate` method is called when the connection is closed while receiving a message. This ca

(self, callback: Optional[Callable[[], None]])

Source from the content-addressed store, hash-verified

315 self.stream.set_close_callback(None)
316
317 def set_close_callback(self, callback: Optional[Callable[[], None]]) -> None:
318 """Sets a callback that will be run when the connection is closed.
319
320 Note that this callback is slightly different from
321 `.HTTPMessageDelegate.on_connection_close`: The
322 `.HTTPMessageDelegate` method is called when the connection is
323 closed while receiving a message. This callback is used when
324 there is not an active delegate (for example, on the server
325 side this callback is used if the client closes the connection
326 after sending its request but before receiving all the
327 response.
328 """
329 self._close_callback = callback
330
331 def _on_connection_close(self) -> None:
332 # Note that this callback is only registered on the IOStream

Callers 2

_read_messageMethod · 0.45
_clear_callbacksMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected