From c8c8bf8497333a4414646a1787ea85e80c76d6a0 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Wed, 17 Jun 2015 15:06:10 +0200 Subject: [PATCH] Reworded the subscriber introduction --- cookbook/event_dispatcher/event_listener.rst | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/cookbook/event_dispatcher/event_listener.rst b/cookbook/event_dispatcher/event_listener.rst index 6ef9f399026..f736b9208a6 100644 --- a/cookbook/event_dispatcher/event_listener.rst +++ b/cookbook/event_dispatcher/event_listener.rst @@ -113,9 +113,15 @@ Creating an Event Subscriber ---------------------------- Another way to listen to events is via an **event subscriber**, which is a class -that can define one or more methods that listen to one or various events. The -event priority can be defined for each method (the higher the priority, the earlier -the method is called). To learn more about event subscribers, read :doc:`/components/event_dispatcher/introduction`. +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 priority, the earlier the method is called). To learn more +about event subscribers, read :doc:`/components/event_dispatcher/introduction`. + The following example shows an event subscriber that defines several methods which listen to the same ``kernel.exception`` event::