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

Skip to content

Commit c8c8bf8

Browse files
committed
Reworded the subscriber introduction
1 parent 36b1d10 commit c8c8bf8

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

cookbook/event_dispatcher/event_listener.rst

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,15 @@ Creating an Event Subscriber
113113
----------------------------
114114

115115
Another way to listen to events is via an **event subscriber**, which is a class
116-
that can define one or more methods that listen to one or various events. The
117-
event priority can be defined for each method (the higher the priority, the earlier
118-
the method is called). To learn more about event subscribers, read :doc:`/components/event_dispatcher/introduction`.
116+
that defines one or more methods that listen to one or various events. The main
117+
difference with the event listeners is that subscribers always know which events
118+
they are listening to.
119+
120+
In a given subscriber, different methods can listen to the same event. The order
121+
in which methods are executed is defined by the ``priority`` parameter of each
122+
method (the higher the priority, the earlier the method is called). To learn more
123+
about event subscribers, read :doc:`/components/event_dispatcher/introduction`.
124+
119125
The following example shows an event subscriber that defines several methods which
120126
listen to the same ``kernel.exception`` event::
121127

0 commit comments

Comments
 (0)