Skip to content

Adopt a custom shared client #18

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

Merged
merged 3 commits into from
Sep 18, 2023

Conversation

czechboy0
Copy link
Collaborator

Motivation

We previously defaulted the HTTPClient to .init(), but that's not correct as it was never getting shut down.

Modifications

Instead of creating a new client, just introduce our own shared one and use that as the default value.

Once AHC provides a shared client, we can default to that in the configuration initializer.

Result

No more crashing clients on dealloc.

Test Plan

All tests pass.

Copy link
Collaborator

@dnadoba dnadoba left a comment

Choose a reason for hiding this comment

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

Almost

Co-authored-by: David Nadoba <dnadoba@gmail.com>
@czechboy0
Copy link
Collaborator Author

@dnadoba Try #3? 🙏

Copy link
Collaborator

@dnadoba dnadoba left a comment

Choose a reason for hiding this comment

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

Excellent!

@czechboy0 czechboy0 merged commit f228a33 into swift-server:main Sep 18, 2023
@czechboy0 czechboy0 deleted the hd-use-shared-client branch September 18, 2023 13:38
@czechboy0 czechboy0 added the 🔨 semver/patch No public API change. label Sep 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔨 semver/patch No public API change.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants