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

Method _clear_callbacks

python/python3/tornado/http1connection.py:305–315  ·  view source on GitHub ↗

Clears the callback attributes. This allows the request handler to be garbage collected more quickly in CPython by breaking up reference cycles.

(self)

Source from the content-addressed store, hash-verified

303 return True
304
305 def _clear_callbacks(self) -> None:
306 """Clears the callback attributes.
307
308 This allows the request handler to be garbage collected more
309 quickly in CPython by breaking up reference cycles.
310 """
311 self._write_callback = None
312 self._write_future = None # type: Optional[Future[None]]
313 self._close_callback = None # type: Optional[Callable[[], None]]
314 if self.stream is not None:
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.

Callers 6

__init__Method · 0.95
_read_messageMethod · 0.95
_on_connection_closeMethod · 0.95
closeMethod · 0.95
detachMethod · 0.95
_finish_requestMethod · 0.95

Calls 1

set_close_callbackMethod · 0.45

Tested by

no test coverage detected