-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
WIP: ASGI Integration #1265
WIP: ASGI Integration #1265
Conversation
This seems stalled again. Is this still a priority? This along with Gino makes sanic quite appealing for a project we just got approval for at work. Without working web sockets, it is a non starter for us (unless I am understanding things incorrectly). |
Sanic has working websocket support, so I'm not sure if this issue is relevant to you or not. |
I think this is something that is definitely on the radar. It makes sense that if As said above, websockets are a part of sanic now. So, if that is what you need to move forward, you should be able to. Right now the Sanic team is doing a little reorganizing to shift to being a community run organization. Part of the discussions have included placing a greater emphasis on websockets. That, plus this being a "proof of concept" PR puts a little pause on this before we would merge this asgi support PR. @tomchristie graciously put some effort into making this work inside Sanic, and I do believe this (or something that achieves this) will be adopted. |
All sounds super positive! Up for being involved/helping out as needed. Cheers! |
@tomchristie can you update your fork so we can get the tests to run again against current master? |
Tagged this for inclusion for 19.03 |
We can leave this one closed in favor of #1475. I am going to start working on the test client issue. |
Quick proof-of-concept for adding ASGI support to Sanic.
Refs. #761
Makes the following possible:
Then:
uvicorn example:app # Or `daphne` or `hypercorn`.
I've just added this in as dumb-as-possible way for now, as a proof-of-concept.
Note that Ctrl-C to quit may not work properly here, I think due to not having plugged Sanic's exception handling in properly yet.
A more committed approach to moving to ASGI might instead introduce changes to the request/response classes, rather than just adding a dumb shim over the top of Sanic's existing implementation. Additionally it might also adapt the server implementation slightly so that
it actually calls into Sanic applications using ASGI.
Some benefits from moving to ASGI would be:
This PR is more to start a conversation than anything else, and to demonstrate that Sanic's close enough already that moving to ASGI might not necessarily require a massive set of changes.
Obviously I personally think there'd be a big long-term benefit to Sanic moving to an ASGI interface, both for Sanic itself, and for the community as a whole. Tho this PR is more of a proof-of-concept at this stage, than a serious attempt.