Timeout callback of request. Construct a timeout HTTPResponse when a timeout occurs. :arg object key: A simple object to mark the request. :info string key: More detailed timeout information.
(self, key: object, info: Optional[str] = None)
| 228 | del self.waiting[key] |
| 229 | |
| 230 | def _on_timeout(self, key: object, info: Optional[str] = None) -> None: |
| 231 | """Timeout callback of request. |
| 232 | |
| 233 | Construct a timeout HTTPResponse when a timeout occurs. |
| 234 | |
| 235 | :arg object key: A simple object to mark the request. |
| 236 | :info string key: More detailed timeout information. |
| 237 | """ |
| 238 | request, callback, timeout_handle = self.waiting[key] |
| 239 | self.queue.remove((key, request, callback)) |
| 240 | |
| 241 | error_message = f"Timeout {info}" if info else "Timeout" |
| 242 | timeout_response = HTTPResponse( |
| 243 | request, |
| 244 | 599, |
| 245 | error=HTTPTimeoutError(error_message), |
| 246 | request_time=self.io_loop.time() - request.start_time, |
| 247 | ) |
| 248 | self.io_loop.add_callback(callback, timeout_response) |
| 249 | del self.waiting[key] |
| 250 | |
| 251 | |
| 252 | class _HTTPConnection(httputil.HTTPMessageDelegate): |
nothing calls this directly
no test coverage detected