Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add asyncio support #9

Open
snarfed opened this issue Sep 2, 2023 · 0 comments
Open

Add asyncio support #9

snarfed opened this issue Sep 2, 2023 · 0 comments

Comments

@snarfed
Copy link
Owner

snarfed commented Sep 2, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant