Skip to content
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

[DI] New container.service_subscriber & ServiceSubscriberInterface #7740

Closed
weaverryan opened this issue Apr 1, 2017 · 5 comments
Closed

[DI] New container.service_subscriber & ServiceSubscriberInterface #7740

weaverryan opened this issue Apr 1, 2017 · 5 comments

Comments

@weaverryan
Copy link
Member

@weaverryan weaverryan commented Apr 1, 2017

@weaverryan

This comment has been minimized.

Copy link
Member Author

@weaverryan weaverryan commented May 5, 2017

@chalasr This is pretty closely related to #7458, right? Would it make sense to put them all in the same article?

@chalasr

This comment has been minimized.

Copy link
Member

@chalasr chalasr commented May 5, 2017

@weaverryan This is a whole concept (built on top of #7458) allowing to request some entries from the DIC at the PHP level. I think it deserves its own article, the need for this feature should be different that the one for #7458 (right now the class must know which services they want exactly, #7458 is more about collecting tagged services).

@nicolas-grekas pov would be good!

@nicolas-grekas

This comment has been minimized.

Copy link
Member

@nicolas-grekas nicolas-grekas commented May 5, 2017

It's like event listeners vs subscribers.
Personally, I'd advocate to promote subscribers over listeners, for events and for services.

@chalasr

This comment has been minimized.

Copy link
Member

@chalasr chalasr commented May 5, 2017

I agree and it's already the case for events, that doesn't make listeners useless though. But creating locators by hand remain the way to go for collecting services for a given tag, that is especially useful for third party libs/bundles and the core. Opened symfony/symfony#22649 for a related proposal.

@codedmonkey

This comment has been minimized.

Copy link
Contributor

@codedmonkey codedmonkey commented Feb 8, 2018

I've created a concept page in #9223. It still needs some improvements though, especially properly describing getSubscribedServices(). It's probably also worth mentioning on the page that you're probably already using it through AbstractController. Any thoughts?

@wouterj wouterj closed this in bcbbd15 Apr 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants
You can’t perform that action at this time.