title: Listener not triggered by the event dispatcher
body: <p>I want to execute symfony function after returning response in controller.</p>
  
  <p>How can I do that ?</p>
  
  <p>Here are all classes I used:</p>
  
  <p>Define all events : here we have only one event defined inside this class</p>
  
  <pre><code>&lt;?php
  # AcmeEvents.php
  namespace test\apiBundle;
  
  final class AcmeEvents
  {
      const AFTER_RETURN_RESPONSE = "acme.after_return_response";
  }
  </code></pre>
  
  <p>Define the listener</p>
  
  <pre><code>&lt;?php
  #TestSubscriber.php
  namespace test\apiBundle\EventListener;
  
  use Symfony\Component\EventDispatcher\EventSubscriberInterface;
  use test\apiBundle\AcmeEvents;
  
  use Symfony\Component\Filesystem\Filesystem;
  
  class TestSubscriber implements EventSubscriberInterface
  {
      public function __construct()
      {
      }
  
      public static function getSubscribedEvents()
      {
          return array(
              AcmeEvents::AFTER_RETURN_RESPONSE =&gt; 'processingFunction'
          );
      }
  
      public function processingFunction(Event $event)
      {
          $fs = new Filesystem();
          $fs-&gt;touch('files/myfile.json', 0700);
      }
  }
  </code></pre>
  
  <p>Define the controller where the event is triggered</p>
  
  <pre><code>&lt;?php
  #WelcomeController.php
  namespace test\apiBundle\Controller;
  
  #use all other components
  use Symfony\Component\EventDispatcher\EventDispatcher;
  
  use test\apiBundle\AcmeEvents;
  
  class WelcomeController extends Controller
  {
      public function getWelcomeAction()
      {
          # all other processes
          $event = new UploadEvent();
          $dispatcher = new EventDispatcher();
          $dispatcher-&gt;dispatch(
              'AcmeEvents::AFTER_RETURN_RESPONSE', $event
          );
          return $response;
      }
  }
  </code></pre>