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

ASGI support #63

Merged
merged 11 commits into from
Apr 9, 2018
Merged

ASGI support #63

merged 11 commits into from
Apr 9, 2018

Conversation

tomchristie
Copy link
Member

@tomchristie tomchristie commented Apr 6, 2018

Since the ASGI specification has been updated it now fulfils the requirements that the "Uvicorn Messaging Interface" was intended to bridge.

This pull request updates Uvicorn to become an ASGI-compliant webserver.

  • I've currently dropped the flow control, which will need to be updated.
  • I've currently dropped the websocket handling, which will need to be updated.
  • After this change, Uvicorn will no longer support API Star 0.3, which uses the old "Uvicorn Messaging Interface". Users wanting to run API Star 0.3 async applications will need to stick with version 0.0.15. There is an API Star 0.4 version shortly due to be released, which updates API Star async apps to use ASGI.


def on_url(self, url):
parsed = httptools.parse_url(url)
method = self.request_parser.get_method()
http_version = self.request_parser.get_http_version()
self.message.update({
self.scope = {
'type': 'http.request',
Copy link
Sponsor Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The connection scope type needs to be set to 'type': 'http'.

https://github.com/django/asgiref/blob/master/specs/www.rst#connection-scope

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@tomchristie tomchristie merged commit 89d3fc1 into master Apr 9, 2018
@tomchristie tomchristie deleted the asgi branch July 10, 2018 18:16
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

Successfully merging this pull request may close these issues.

None yet

2 participants