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 AHC's .shared singleton as the default Client #39

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-ahc-shared-singleton
Oct 3, 2024

Conversation

Copy link
Collaborator

@czechboy0 czechboy0 commented Sep 23, 2024

Motivation

As a convenience when you don't need to create a custom AHC Client instance, we provide a singleton client as the default. AHC added their own Client.shared singleton, so let's adopt that and remove the transport's internal singleton, which was used for the same purpose.

Modifications

  • Replaced the tranport's internal singleton with the AHC-provided one.
  • Use Int64 directly and skip conversions now that AHC also uses Int64 for the body byte size.

Result

  • No internal singleton is created now, possibly avoiding having two AHC singletons in a given process.
  • Fixed a warning around Int/Int64 conversion.

Test Plan

Unit tests still pass.

@czechboy0 czechboy0 enabled auto-merge (squash) September 23, 2024 07:35
@czechboy0 czechboy0 merged commit 7b96b1d into swift-server:main Oct 3, 2024
5 checks passed
@czechboy0 czechboy0 deleted the hd-ahc-shared-singleton branch October 3, 2024 15:52
@simonjbeaumont simonjbeaumont added 🔨 semver/patch No public API change. 🆕 semver/minor Adds new public API. and removed 🔨 semver/patch No public API change. labels Dec 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers

@simonjbeaumont simonjbeaumont simonjbeaumont left review comments

@glbrntt glbrntt glbrntt approved these changes

Assignees
No one assigned
Labels
🆕 semver/minor Adds new public API.
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

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