Has StatelessServer been updated to the ASGI 3.0 spec?
See original GitHub issueI’m currently trying to upgrade my app from Channels 2.4.0 to Channels 3.0.0 and I’m having issues with running my worker.
After some investigation, I’m under the impression that the StatelessServer
provided in asgiref
hasn’t been updated to the new Application specifications in ASGI 3.0.
Part of StatelessServer that is trying to instantiate an application with a scope, then call it using the receive and send arguments: https://github.com/django/asgiref/blob/5c249e818bd5e7acef957e236535098c3aff7b42/asgiref/server.py#L87-L94
Specification for the new Application format: https://asgi.readthedocs.io/en/latest/specs/main.html#applications
That is: coroutine application(scope, receive, send)
Since the Worker in Channels is based on StatelessServer
, this is breaking the worker functionality in Channels 3.0.0.
Is this something that is in the works? Anything I can do to help with this?
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:8 (6 by maintainers)
Hi @davidmarquis.
A failing test case on Channels would be super helpful from my POV.
Happy to push whatever back up here, if needed, but we’re obviously missing coverage below stairs.
Thanks for the input!
Hi @davidmarquis.
I’m away from the computer right now but that sounds like a plausible analysis yes. (Static file wrapper is the asgi app right, so call should be async def)
Do open a PR on channels! If you start with the test case it’ll be easy to see that it’s wrong.
Thanks so much for taking the time to dig in! (I’ll look back in over the weekend.)