title: Streaming a Response in Symfony2
body: <p>I am trying this example from the doc: <a href="http://symfony.com/doc/master/components/http_foundation/introduction.html#streaming-a-response" rel="noreferrer">Streaming a Response in Symfony2</a>.</p>
  
  <pre class="lang-php prettyprint-override"><code>/**
   * @param Request $request
   * @return Response $render
   * @Route("/streamedResponse", name="streamed_response")
   * @Template("AcmeTestBundle::streamedResponse.html.twig")
   */
  public function streamedResponseAction(Request $request)
  {
      $response = new StreamedResponse();
      $response-&gt;setCallback(function () {
          echo 'Hello World';
          flush();
          sleep(3);
          echo 'Hello World';
          flush();
      });
  
      return $response;
  
  }
  </code></pre>
  
  <p>This outputs everything at the same time. Have I done something wrong?</p>