Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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
czechboy0 merged 3 commits into swift-server:main from czechboy0:hd-use-shared-client
Sep 18, 2023

Conversation

Copy link
Collaborator

@czechboy0 czechboy0 commented Sep 18, 2023

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

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
Reviewers

@dnadoba dnadoba dnadoba approved these changes

Assignees
No one assigned
Labels
🔨 semver/patch No public API change.
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /