Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[EventDispatcher]Get priority on listeners/subscribers #14302

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

Closed
dupuchba opened this issue Apr 10, 2015 · 8 comments
Closed

[EventDispatcher]Get priority on listeners/subscribers #14302

dupuchba opened this issue Apr 10, 2015 · 8 comments

Comments

@dupuchba
Copy link
Contributor

Hello all,

I'd like to know if there is a way to retrieve listeners/subscribers priority.
There is nothing specified in the EventDispatcherInterface.
@stof as a merger of this component can you tell me ?

Another question I have is why we implicitly sort listeners in getListeners in the EventDispatcher.php. It's confusing to me because as a user of getListeners I am not aware that listeners are already sorted..

@stof
Copy link
Member

stof commented Apr 10, 2015

@dupuchba there is no way to get the priorities.

regarding the fact that the listeners are returned sorted, feel free to send a PR improving the phpdoc to mention it.

@dupuchba
Copy link
Contributor Author

@stof Ok, thx :-).

But what do you think about decoupling the sorting of listeners and their "getting".
Besides is this the right design behavior to not being able to get priority ?

@stof
Copy link
Member

stof commented Apr 10, 2015

@dupuchba how would you decouple it ? and we cannot return them not sorted. It would be a BC break. getListeners is expected to give the listeners in the order in which they will be called.

@dupuchba
Copy link
Contributor Author

I don't know how to decouple it, it might be a terrible idea. I still added some information on the phpdoc #14304 .
My main goal is to fetch priorities, I have if it's possible and desirable

@dupuchba
Copy link
Contributor Author

@stof just to continue on our discussion, do you see any value on being able to retrieve the priority of a given listener/subscriber ?

@jakzal
Copy link
Contributor

jakzal commented Apr 16, 2015

there's already a discussion about it in #11263

@jakzal jakzal closed this as completed Apr 16, 2015
@dupuchba
Copy link
Contributor Author

@jakzal you just closed the other one :(

@stof
Copy link
Member

stof commented Apr 17, 2015

@dupuchba the other one is not closed

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

No branches or pull requests

3 participants