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

Switch foxglove client to using Requests.Session #108

Merged
merged 2 commits into from
Oct 11, 2024

Conversation

rg-gravis
Copy link
Contributor

Changelog

Increase performance when making multiple requests by using HTTP keep-alive.

Docs

None

Description

Switch from using raw requests methods to using a requests.Session object, which automatically uses keep-alive connections and connection pooling (as per https://docs.python-requests.org/en/latest/user/advanced/). This makes the client faster when making multiple API calls in succession, because it doesn't need to re-negotiate a TCP connection for each call. The session object can also hold the headers and use them for every request.
Tested with unit tests and examples/downloading_data.py

@eloff
Copy link

eloff commented Oct 1, 2024

This looks great, thanks for making this improvement. @james-rms can you think of any potential problems here? I couldn't see any.

@james-rms
Copy link
Contributor

Seems good - @rg-gravis please sign the CLA and we can merge.

@rg-gravis
Copy link
Contributor Author

Seems good - @rg-gravis please sign the CLA and we can merge.

sure - where is the CLA and how would you like me to sign?

@defunctzombie defunctzombie reopened this Oct 11, 2024
@defunctzombie defunctzombie merged commit aa8a269 into foxglove:main Oct 11, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants