-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Create BaseHTTPConnection APIs #2768
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great, and I love how this highlights improvements that we could carry on today.
The internal property usage is a big problem.
Have you studied HTTP1Connection from the v2 branch and hip? https://github.com/python-trio/hip/blob/e198149c677edbeec023aeb934758c9195a4d2e3/src/ahip/connection.py#L317-L565? I think there are valuable lessons there.
Finally, I think those notes stand on their own, and I would happy to merge them as-is.
4064d72
to
0605d81
Compare
0c64764
to
23f08a3
Compare
23f08a3
to
1c786b8
Compare
1c786b8
to
e78d192
Compare
Noting this down for future me because I have to leave: default |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome work. 👏
afc660e
to
65aa35a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me, thank you! I've left a few comments, but this does not need another round of review. 🎉
For reference this did not document the removal of the VerifiedHTTPSConnection class ( despite its rename in #1805 ) from the connectionpool module. edit: noted the module detail. |
@vEpiphyte You can use Why did you need this? |
@pquentin Looking into this issue in vcrpy ( which you commented on, thank you very much! ) kevin1024/vcrpy#688 since that has caused an immediate outage for myself and my downstream users. Almost more so a note for myself, since git bisect & github's compare feature didn't quickly tell me where the removal of the import came from. For example, 2.0.1...1.26.15 does not show the removal of the import from connection.py. |
Closes #1985
Started by taking apart and documenting the HTTP connection (+pool) lifecycle and what would be necessary at every stage. Decided it might be good to document these in notes that we can keep up to date once we settle on an API.
In general I'd like to fix up a bit of our super complicated proxy situation (cc @jalopezsilva) since we technically "own" the HTTPConnection API. Timeouts are similarly complicated but done in multiple ways.
There's some more features I want to dig into and document like
HTTPConnection.auto_open
which appears to be to do with whether a connection is reusable.I have some local work creating a
BaseHTTPConnection
protocol and trying it with type hints but that's not quite ready yet.