Skip to content

Commit 9edf125

Browse files
committed
Merge branch '4.4' into 5.0
* 4.4: Tweak the explanation about event priorities
2 parents 835c41c + ca66935 commit 9edf125

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

event_dispatcher.rst

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -139,10 +139,12 @@ that defines one or more methods that listen to one or various events. The main
139139
difference with the event listeners is that subscribers always know which events
140140
they are listening to.
141141

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

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

0 commit comments

Comments
 (0)