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)
| 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.""" |
no test coverage detected