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

Optional HTTP/2 #121

Merged
merged 4 commits into from
Aug 2, 2020
Merged

Optional HTTP/2 #121

merged 4 commits into from
Aug 2, 2020

Conversation

tomchristie
Copy link
Member

For consideration.
We might want to think again about having HTTP/2 be an optional install for our httpx 1.0 release onwards.

Done:

  • Provide a base HTTP Connection class interface, that is agnostic of HTTP/1.1 and HTTP/2.
  • Use the base HTTP Connection class for the .connection signature in AsyncHTTPConnection.
  • Lazily import either AsyncHTTP11Connection or AsyncHTTP2Connection as required.

To do:

  • Import h2 in AsyncConnectionPool if http2=True is set, so that we get nice early errors if it is not installed.
  • Move h2 to an optional install, requiring pip install httpcore[http2]

@tomchristie tomchristie added this to the 0.10.0 milestone Jul 31, 2020
@tomchristie tomchristie added the enhancement New feature or request label Jul 31, 2020
@tomchristie
Copy link
Member Author

@florimondmanca - I think we ought to look at getting this one in, and treat the remaining issues as a follow up...

  • Import h2 in AsyncConnectionPool if http2=True is set, so that we get nice early errors if it is not installed.
  • Move h2 to an optional install, requiring pip install httpcore[http2]

That'll get us in good shape and allow us to make a judgement call on if we want optional HTTP/2 for httpx 0.14 or if we're waiting for 1.0.

@florimondmanca
Copy link
Member

@tomchristie Okay, I thought you meant to bring the remaining TODOs in this PR which is why I held back on reviewing. Will review soon then. :-)

Copy link
Member

@florimondmanca florimondmanca left a comment

Choose a reason for hiding this comment

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

Very nice!

@tomchristie
Copy link
Member Author

Right, let's do this...

@tomchristie tomchristie merged commit 623f3c8 into master Aug 2, 2020
@tomchristie tomchristie deleted the optional-http2 branch August 2, 2020 11:42
This was referenced Aug 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants