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

Appearance settings

[DI] add ServiceLocatorTagPass::register() to share service locators #22175

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 1 commit into from
Apr 3, 2017

Conversation

nicolas-grekas
Copy link
Member

@nicolas-grekas nicolas-grekas commented Mar 27, 2017

Q A
Branch? master
Bug fix? yes
New feature? yes
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets -
License MIT
Doc PR -

Right now, one service locator is created per controller / service subscriber. But since service locators are stateless, this is just wasting resources when several controllers have the exact same set of services managed by their locators (as would be the case when registering the new AbstractController as a service subscribers).

This PR fixes this issue, and a few related others found along the way.

@chalasr
Copy link
Member

chalasr commented Mar 27, 2017

👍
Status: reviewed

@nicolas-grekas nicolas-grekas force-pushed the di-share-locators branch 2 times, most recently from 7144c13 to 31657cc Compare March 28, 2017 16:01
@nicolas-grekas nicolas-grekas changed the title [DI] add ServiceClosureArgument::register() to share service locators [DI] add ServiceLocatorTagPass::register() to share service locators Mar 29, 2017
@nicolas-grekas nicolas-grekas force-pushed the di-share-locators branch 2 times, most recently from ba03a95 to 659df71 Compare March 30, 2017 12:51
}

/**
* @param Reference[] $refMap
Copy link
Member

Choose a reason for hiding this comment

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

the phpdoc does not match the signature (which can confuse some IDEs which will ask consumers to pass the refMap as first argument)

Copy link
Member Author

Choose a reason for hiding this comment

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

fixed

Copy link
Member

@stof stof left a comment

Choose a reason for hiding this comment

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

👍

@fabpot
Copy link
Member

fabpot commented Apr 3, 2017

Thank you @nicolas-grekas.

@fabpot fabpot merged commit 8ff764b into symfony:master Apr 3, 2017
fabpot added a commit that referenced this pull request Apr 3, 2017
…rvice locators (nicolas-grekas)

This PR was merged into the 3.3-dev branch.

Discussion
----------

[DI] add ServiceLocatorTagPass::register() to share service locators

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | yes
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

Right now, one service locator is created per controller / service subscriber. But since service locators are stateless, this is just wasting resources when several controllers have the exact same set of services managed by their locators (as would be the case when registering the new `AbstractController` as a service subscribers).

This PR fixes this issue, and a few related others found along the way.

Commits
-------

8ff764b [DI] add ServiceLocatorTagPass::register() to share service locators
@nicolas-grekas nicolas-grekas deleted the di-share-locators branch April 4, 2017 08:37
@fabpot fabpot mentioned this pull request May 1, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.