-
-
Notifications
You must be signed in to change notification settings - Fork 805
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
Recent version of channels doesn't support ASGI3 #1319
Comments
As for now, I just created subclass of
|
This is related to #1316.
Short answer, yes. I'm working on an update for Daphne now, and then will be coming back to update Channels. Any help in the form of PRs towards that would be awesome! |
Hi, could you share how you solved it? I can't get it to work. |
N.B. you should be able to wrap Channels ASGI 2 apps with |
piggybacking on this @adamchainz i tried your solution and wrapped my application in |
I think you’re wrapping the wrong app @mburke05 . |
hm, i've tried wrapping:
assuming that's what you mean, but i'm getting the same result. (Django=3.0.2,channels=2.4.0) just for posterity the full error:
edit: fwiw i fixed this it looks like with a fresh install (i think it may have been a result of twisted not behaving with windows 10 but unsure), but i'll leave it in case the app wrapping question gets answered for someone in the future) |
@carltongibson I'd love to help out with this. Any advice for where to start? |
Hi @jaydenwindle. Take a look here: https://asgi.readthedocs.io/en/latest/specs/main.html#applications — This explains the change from the double to single callable. For now we can just wrap our channels apps, as @adamchainz says. First step might be to add a note to that effect to the docs. But longer term, and this is #1316 too is to migrate everything across to single callable. Maybe we could adjust the various Routers to the new style first, using asgiref.compatibility to embed consumers. Then the consumers and so on. If you want to take this on, I'd be very happy to support you: we would need to work out a roadmap and document where we were for people adapting, but it should be possible to do it incrementally. And it does need doing. |
@jaydenwindle There aren't that many classes. Maybe it makes sense to bump them all at once and do a major version release with a migration guide. That's a bigger chunk of work all at once though... |
@carltongibson Sounds good! I'd love to take this on. I think it makes sense to release the ASGI 3 changes all at once. I'll raise a couple of PRs for this so it's easier to review. Using Do we want to add in deprecation warnings for users that are still using the legacy-style double callables? |
Not sure yet. Argh! 🙂 — Start and I'll try it out and see what I need to do to migrate. The difficulty is going to be when we've subclassed the generic consumers. I'm guessing the upgrade steps will be enough of a warning. |
@carltongibson Haha alright, sounds good 🙂 |
This worked for me when i had this issue today. I'm following the tutorial on read the docs. |
Fixed in Channels v3. |
Since the recent version of daphne (
2.3.0
) added support for ASGI3, I no longer can't use channels (2.2.0
).https://github.com/django/daphne/blob/master/daphne/cli.py#L30
Here it would likely to call channel's router ( ProtocolTypeRouter) with additional two parameters (
send
,receive
) which by now (channels/channels/routing.py
Line 56 in 2486738
Can we have support for ASGI3?
The text was updated successfully, but these errors were encountered: