Skip to content

Commit

Permalink
Merge branch '4.4' into 5.0
Browse files Browse the repository at this point in the history
* 4.4:
  Tweak the explanation about event priorities
  • Loading branch information
javiereguiluz committed Dec 11, 2019
2 parents 835c41c + ca66935 commit 9edf125
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions event_dispatcher.rst
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,12 @@ that defines one or more methods that listen to one or various events. The main
difference with the event listeners is that subscribers always know which events
they are listening to.

In a given subscriber, different methods can listen to the same event. The order
in which methods are executed is defined by the ``priority`` parameter of each
method (the higher the number the earlier the method is called). To learn more
about event subscribers, read :doc:`/components/event_dispatcher`.
If different event subscriber methods listen to the same event, their order is
defined by the ``priority`` parameter. This value is a positive or negative
integer which defaults to ``0``. The higher the number, the earlier the method
is called. **Priority is aggregated for all listeners and subscribers**, so your
methods could be executed before or after the methods defined in other listeners
and subscribers. To learn more about event subscribers, read :doc:`/components/event_dispatcher`.

The following example shows an event subscriber that defines several methods which
listen to the same ``kernel.exception`` event::
Expand Down

0 comments on commit 9edf125

Please sign in to comment.