Clears the callback attributes. This allows the request handler to be garbage collected more quickly in CPython by breaking up reference cycles.
(self)
| 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. |
no test coverage detected