question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Has StatelessServer been updated to the ASGI 3.0 spec?

See original GitHub issue

I’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:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:8 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
carltongibsoncommented, Nov 3, 2020

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!

1reaction
carltongibsoncommented, Nov 6, 2020

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.)

Read more comments on GitHub >

github_iconTop Results From Across the Web

ASGI (Asynchronous Server Gateway Interface) Specification
This base specification is intended to fix in place the set of APIs by which these servers interact and run application code; each...
Read more >
ASGI Documentation — ASGI 3.0 documentation
ASGI (Asynchronous Server Gateway Interface) is a spiritual successor to WSGI, intended to provide a standard interface between async-capable Python web ...
Read more >
Introduction — ASGI 3.0 documentation - Read the Docs
You may ask “why not just upgrade WSGI”? This has been asked many times over the years, and the problem usually ends up...
Read more >
Extensions — ASGI 3.0 documentation - Read the Docs
The ASGI specification provides for server-specific extensions to be used outside ... to a new instance of the application and treat it as...
Read more >
Implementations — ASGI 3.0 documentation - Read the Docs
Channels is the Django project to add asynchronous support to Django and is the original driving force behind the ASGI project. Supports HTTP...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found