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

feat: persist the HTTP client inside of EasyPostClient #322

Merged
merged 2 commits into from
Nov 29, 2023

Conversation

Justintime50
Copy link
Member

@Justintime50 Justintime50 commented Nov 29, 2023

Description

We previously recreated the Guzzle Client on every request. This PR moves the creation of the HTTP client into the EasyPostClient object to ensure that back-to-back requests using the same EasyPostClient will reuse the same HTTP client to reduce memory consumption. There should be no user impact with this change.

Please note that although the HTTP client is now a publicly accessible property of the EasyPostClient, it is not intended to be replaced as no additional work has been made yet to allow this (see #318 for that initiative)

Closes #315

Testing

Re-recorded a cassette with two requests to ensure it works as expected

Pull Request Type

Please select the option(s) that are relevant to this PR.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Improvement (fixing a typo, updating readme, renaming a variable name, etc)

@Justintime50 Justintime50 requested a review from a team November 29, 2023 21:01
@Justintime50 Justintime50 merged commit e6e4176 into master Nov 29, 2023
6 checks passed
@Justintime50 Justintime50 deleted the 315_persistent_http_client branch November 29, 2023 21: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.

[Feat]: Support Persistent GuzzleClient Instance
3 participants