Skip to content

Add asyncio support #9

Description

@snarfed

This would mainly just be in docs and the demo PDS, hopefully I shouldn't have to change much or any of the subscription XRPC handler code (eg xrpc_sync.subscribe_repos) itself. The current design is that subscription handlers are just generators, which I think I can wrap in an asyncio coroutine to be served in eg an ASGI framework and server.

Sadly flask-sock doesn't support asyncio though, miguelgrinberg/flask-sock#47. Flask-SocketIO supposedly does, miguelgrinberg/Flask-SocketIO#1193 , but I can't tell if it's real, ie it pauses the coroutine while it's waiting to receive data from (or send to) the client, or if it's just compatible and can be run in an asyncio event loop but still blocks an entire thread. I need to learn more, or maybe try it and see.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions