Skip to content

Conversation

czechboy0
Copy link
Collaborator

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

Labels

🆕 semver/minor Adds new public API.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants