Movatterモバイル変換


[0]ホーム

URL:


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

[FrameworkBundle][HttpClient] Refactor http_client decoration strategy#49513

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
nicolas-grekas merged 1 commit intosymfony:6.3fromfancyweb:fwb/http-client-cfg
Feb 24, 2023

Conversation

fancyweb
Copy link
Contributor

QA
Branch?6.3
Bug fix?no
New feature?no
Deprecations?no
Tickets#49302 (comment)
LicenseMIT
Doc PR-

@nicolas-grekas
Copy link
Member

Rebase unlocked after#49302

@fancywebfancywebforce-pushed thefwb/http-client-cfg branch 2 times, most recently from52e5f75 to237f7b6CompareFebruary 24, 2023 08:48
@@ -2413,7 +2406,7 @@ private function registerHttpClientConfiguration(array $config, ContainerBuilder
->register($name.'.uri_template', UriTemplateHttpClient::class)
->setDecoratedService($name, null, 7) // Between TraceableHttpClient (5) and RetryableHttpClient (10)
->setArguments([
new Reference('.inner'),
new Reference($name.'.uri_template.inner'),

Choose a reason for hiding this comment

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

let's be consistent with the rest of the file


->set('http_client', HttpClientInterface::class)
->factory('current')
->args([[service('http_client.transport')]])
Copy link
Member

@nicolas-grekasnicolas-grekasFeb 24, 2023
edited
Loading

Choose a reason for hiding this comment

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

Here is the master trick of this PR :)
This creates what I'd call a "tagged alias".

@nicolas-grekas
Copy link
Member

Thank you@fancyweb.

@nicolas-grekasnicolas-grekas merged commit3b207f2 intosymfony:6.3Feb 24, 2023
nicolas-grekas added a commit that referenced this pull requestFeb 24, 2023
… used as service factory (nicolas-grekas)This PR was merged into the 6.3 branch.Discussion----------[DependencyInjection] Optimize out "current()" when it's used as service factory| Q             | A| ------------- | ---| Branch?       | 6.3| Bug fix?      | no| New feature?  | no| Deprecations? | no| Tickets       | -| License       | MIT| Doc PR        | -Sometimes, we need to use the "identity function" as a service factory.One example is#49513, where we use that to create a "tagged alias".In PHP, the identity function is `current([$foo])`.Let's optimize out such calls.Commits-------834a550 [DependencyInjection] Optimize out "current()" when it's used as service factory
@fancywebfancyweb deleted the fwb/http-client-cfg branchFebruary 24, 2023 14:53
fabpot added a commit that referenced this pull requestJan 2, 2025
… (HypeMC)This PR was merged into the 6.4 branch.Discussion----------[HttpClient] Fix `reset()` not called on decorated clients| Q             | A| ------------- | ---| Branch?       | 6.4| Bug fix?      | yes| New feature?  | no| Deprecations? | no| Issues        | -| License       | MITThis was broken in#49513 for the main HTTP client and, as far as I can tell, never worked for scoped clients. The problem is that some decorator clients, like the `ThrottlingHttpClient`, have their own `reset()` method, which never gets called when using the `services_resetter` service. Scoped clients don't decorate the main one but instead use it as a dependency.Commits-------8f5f98a [HttpClient] Fix reset not called on decorated clients
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@nicolas-grekasnicolas-grekasnicolas-grekas approved these changes

Assignees
No one assigned
Projects
None yet
Milestone
6.3
Development

Successfully merging this pull request may close these issues.

3 participants
@fancyweb@nicolas-grekas@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp