Clears the callback attributes. This allows the request handler to be garbage collected more quickly in CPython by breaking up reference cycles.
(self)
| 310 | return True |
| 311 | |
| 312 | def _clear_callbacks(self) -> None: |
| 313 | """Clears the callback attributes. |
| 314 | |
| 315 | This allows the request handler to be garbage collected more |
| 316 | quickly in CPython by breaking up reference cycles. |
| 317 | """ |
| 318 | self._write_callback = None |
| 319 | self._write_future = None # type: Optional[Future[None]] |
| 320 | self._close_callback = None # type: Optional[Callable[[], None]] |
| 321 | if self.stream is not None: |
| 322 | self.stream.set_close_callback(None) |
| 323 | |
| 324 | def set_close_callback(self, callback: Optional[Callable[[], None]]) -> None: |
| 325 | """Sets a callback that will be run when the connection is closed. |
no test coverage detected