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

Fixed event listeners priority #3719

Closed

Conversation

tony-co
Copy link
Contributor

@tony-co tony-co commented Mar 25, 2014

Q A
Doc fix? yes
New docs? no
Applies to all
Fixed tickets -

from -255 to 255, and the warmers will be executed in the order of their
priority.
The ``priority`` value is optional, and defaults to 0. The core Symfony
listeners priorities varies from -1024 to 1024, and the warmers will be
Copy link
Contributor

Choose a reason for hiding this comment

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

"vary" because it's listener priorities, no?

Copy link
Member

Choose a reason for hiding this comment

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

indeed

Copy link
Member

Choose a reason for hiding this comment

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

and the comma before "and" should be removed

@saro0h
Copy link
Contributor

saro0h commented Mar 25, 2014

👍

@wouterj
Copy link
Member

wouterj commented Mar 25, 2014

For the next time you submit a fix: If you answer "all" to "Applies to", you should base your PR on the 2.3 branch (since it's the oldest still maintained version). If you answer with a version to "Applies to", it should be based on the branch representing that version (where master is the dev version)

@tony-co
Copy link
Contributor Author

tony-co commented Mar 25, 2014

@wouterj Ok got it.

@wouterj
Copy link
Member

wouterj commented Mar 26, 2014

Actually, this is not true. The core cache warmers are:

One has a priority of 20, the other two have a priority of 0.

The previous sentence was also not true, there are no limitations of the priority.

@tony-co
Copy link
Contributor Author

tony-co commented Mar 26, 2014

Indeed.
I was confused by the table just below listing all listeners with their priorities while this phrase is supposed to be only related to cache warmers. Well maybe this phrase should be move out of the cache warmers paragraph and should explain the priority system for all listeners, what do you think @wouterj ?
http://symfony.com/doc/current/reference/dic_tags.html#kernel-event-listener

@wouterj
Copy link
Member

wouterj commented Mar 26, 2014

Cache warmers are no listeners.

However, I think we should remove "The core Symfony listeners priorities vary from -1024 to 1024 and the warmers will be executed in the order of their priority." completely. It doesn't make sense and is not really usefull... However, we can add a table like for the listeners showing the 3 core cache warmers and their priority.

@lyrixx
Copy link
Member

lyrixx commented Mar 26, 2014

We need a sentence that explain "The bigger the priority, the sooner is the execution".

@tony-co
Copy link
Contributor Author

tony-co commented Mar 26, 2014

Okay, I removed the phrasing and put a quick note about priority along with a table of the three cache warmers.

The higher the priority, the sooner it gets executed.

kernel.cache_warmer
..............
Copy link
Member

Choose a reason for hiding this comment

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

this should be something like:

Core Cache Warmers
..................

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry about that, it's fixed. I kept the tag name for consistency with the rest of the tables below.

Copy link
Member

Choose a reason for hiding this comment

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

the rest of the tables below refer to event names, not the tag names. Since cache warmers aren't event, they should not be treated the same

The higher the priority, the sooner it gets executed.

Core Cache Warmers
..................
Copy link
Member

Choose a reason for hiding this comment

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

This needs to be ~~~~~~~~~ here. Small detail, but it's failing on Travis

@weaverryan
Copy link
Member

Nice addition - thanks for the hard work Tony!

weaverryan added a commit that referenced this pull request Apr 2, 2014
This PR was submitted for the master branch but it was merged into the 2.3 branch instead (closes #3719).

Discussion
----------

Fixed event listeners priority

| Q             | A
| ------------- | ---
| Doc fix?      | yes
| New docs?     | no
| Applies to    | all
| Fixed tickets | -

Commits
-------

47d4d4f Fixed title level consistency
1dbfd29 Updated title for the core cache warmers
a9d07a5 Fixed title underline
815f531 Replaced the priority paragraph with a note and a table
db2c002 Fixed event listeners priority (typos after review)
13b5645 Fixed event listeners priority
@weaverryan weaverryan closed this Apr 2, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants