MCPcopy
hub / github.com/encode/uvicorn / run_asgi

Method run_asgi

uvicorn/protocols/websockets/wsproto_impl.py:325–339  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

323 self.transport.write(output)
324
325 async def run_asgi(self) -> None:
326 try:
327 result = await self.app(self.scope, self.receive, self.send) # type: ignore[func-returns-value]
328 except ClientDisconnected:
329 pass # pragma: full coverage
330 except BaseException:
331 self.logger.exception("Exception in ASGI application\n")
332 self.send_500_response()
333 else:
334 if not self.handshake_complete:
335 self.logger.error("ASGI callable returned without completing handshake.")
336 self.send_500_response()
337 elif result is not None:
338 self.logger.error("ASGI callable should return None, but returned '%s'.", result)
339 self.transport.close()
340
341 async def send(self, message: ASGISendEvent) -> None:
342 await self.writable.wait()

Callers 1

handle_connectMethod · 0.95

Calls 2

send_500_responseMethod · 0.95
closeMethod · 0.45

Tested by

no test coverage detected