MCPcopy
hub / github.com/encode/starlette / WebSocketClose

Class WebSocketClose

starlette/websockets.py:190–196  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

188
189
190class WebSocketClose:
191 def __init__(self, code: int = 1000, reason: str | None = None) -> None:
192 self.code = code
193 self.reason = reason or ""
194
195 async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None:
196 await send({"type": "websocket.close", "code": self.code, "reason": self.reason})

Callers 2

__call__Method · 0.90
not_foundMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected