Skip to content

teleop/quest: run uvicorn on module._loop, remove WS cross-loop bridge #2321

@ruthwikdasyam

Description

@ruthwikdasyam

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions