MCPcopy Create free account
hub / github.com/alpha2phi/python-apps / process_cartoon_ws

Function process_cartoon_ws

cartoon-camera/backend/main.py:102–116  ·  view source on GitHub ↗
(websocket: WebSocket, client_id: int)

Source from the content-addressed store, hash-verified

100
101@app.websocket("/cartoon_ws/{client_id}")
102async def process_cartoon_ws(websocket: WebSocket, client_id: int):
103 await conn_mgr.connect(websocket)
104 try:
105 while True:
106 received = await websocket.receive_text()
107
108 # Process request
109 result = process_incoming_request(received)
110
111 # Send back the result
112 await conn_mgr.send_message(json.dumps(result), websocket)
113
114 except WebSocketDisconnect:
115 conn_mgr.disconnect(websocket)
116 await conn_mgr.broadcast(f"Client #{client_id} left the chat")
117
118
119if __name__ == "__main__":

Callers

nothing calls this directly

Calls 5

process_incoming_requestFunction · 0.85
connectMethod · 0.45
send_messageMethod · 0.45
disconnectMethod · 0.45
broadcastMethod · 0.45

Tested by

no test coverage detected