Problem
QuestTeleopModule runs uvicorn in its own daemon thread (separate asyncio loop), while the camera handlers run on module._loop. Sending JPEG frames to connected WebSocket clients therefore goes through a thread bridge: a _ws_loop reference captured inside the /ws handler, used by a module-level _push_jpeg helper via asyncio.run_coroutine_threadsafe. This works but is convoluted
Refactor req
Move uvicorn onto module._loop so the WebSocket and handle_color_image execute on the same loop, then the push becomes a direct await ws.send_bytes(jpeg)
Problem
QuestTeleopModule runs uvicorn in its own daemon thread (separate asyncio loop), while the camera handlers run on
module._loop. Sending JPEG frames to connected WebSocket clients therefore goes through a thread bridge: a_ws_loopreference captured inside the /ws handler, used by a module-level_push_jpeghelper viaasyncio.run_coroutine_threadsafe. This works but is convolutedRefactor req
Move uvicorn onto
module._loopso the WebSocket andhandle_color_imageexecute on the same loop, then the push becomes a direct awaitws.send_bytes(jpeg)