Skip to content

Add priority order explanation for tagged services #14513

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
Nov 4, 2020

Conversation

hermann8u
Copy link
Contributor

@hermann8u hermann8u commented Nov 3, 2020

Hi,

In this page, the priority order is not explained for tagged services. Since I needed to know this, I guess it is a good addition.
The text is mostly inspired by the paragraph about priority in the event dispatcher documentation : https://symfony.com/doc/current/event_dispatcher.html#creating-an-event-listener

Fell free to edit it or to provide me some advices to do it.

Regards

@carsonbot carsonbot added this to the 5.1 milestone Nov 3, 2020
Copy link
Member

@wouterj wouterj left a comment

Choose a reason for hiding this comment

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

Thank you! I think this makes a lot of sense.

I've suggested a minor move of the text. If you aren't able to make the chance, don't worry! We can do it while merging.

@wouterj wouterj modified the milestones: 5.1, 4.4 Nov 3, 2020
@Nyholm
Copy link
Member

Nyholm commented Nov 3, 2020

Awesome. This is really helpful.

I remember that I've started making a PR once just enable a priority on tagged listeners... but then realising it is already implemented.

@hermann8u
Copy link
Contributor Author

Thank you for your feedbacks :) I have commit your suggestion too.

@javiereguiluz
Copy link
Member

Thank you Florian and congrats on your first Symfony Docs contribution!

@javiereguiluz javiereguiluz merged commit 8b0a921 into symfony:4.4 Nov 4, 2020
@hermann8u hermann8u deleted the patch-1 branch November 4, 2020 09:10
thus providing a way to inject a sorted collection of services:
The tagged services can be prioritized using the ``priority`` attribute.
The priority is a positive or negative integer. The higher the number,
the earlier the tagged service will be located in the collection:
Copy link
Contributor

Choose a reason for hiding this comment

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

Would it make sense to mention the default priority here?

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