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

Method on_connection_close

python/python3/tornado/web.py:306–323  ·  view source on GitHub ↗

Called in async handlers if the client closed the connection. Override this to clean up resources associated with long-lived connections. Note that this method is called only if the connection was closed during asynchronous processing; if you need to do cleanup afte

(self)

Source from the content-addressed store, hash-verified

304 pass
305
306 def on_connection_close(self) -> None:
307 """Called in async handlers if the client closed the connection.
308
309 Override this to clean up resources associated with
310 long-lived connections. Note that this method is called only if
311 the connection was closed during asynchronous processing; if you
312 need to do cleanup after every request override `on_finish`
313 instead.
314
315 Proxies may keep a connection open for a time (perhaps
316 indefinitely) after the client has gone away, so this method
317 may not be called promptly after the end user closes their
318 connection.
319 """
320 if _has_stream_request_body(self.__class__):
321 if not self.request._body_future.done():
322 self.request._body_future.set_exception(iostream.StreamClosedError())
323 self.request._body_future.exception()
324
325 def clear(self) -> None:
326 """Resets all headers and content for this response."""

Callers 1

on_connection_closeMethod · 0.45

Calls 2

_has_stream_request_bodyFunction · 0.85
doneMethod · 0.45

Tested by

no test coverage detected