Skip to content

Commit

Permalink
Reworded the subscriber introduction
Browse files Browse the repository at this point in the history
  • Loading branch information
javiereguiluz committed Sep 2, 2015
1 parent 36b1d10 commit c8c8bf8
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions cookbook/event_dispatcher/event_listener.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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::

Expand Down

0 comments on commit c8c8bf8

Please sign in to comment.