title: Shutdown server after sending a response in ReactPHP
body: <p>I was wondering, how can I shutdown a reactPHP HTTP server after a sending a response.</p>
  <p>Currently I have a server code like this:</p>
  <pre><code>$loop = Factory::create();
  $server = new Server($loop, function (ServerRequestInterface $request) {
      var_dump($request);
      return new Response(200,
          array(
              'Content-Type' =&gt; 'text/plain'
          ),
          &quot;I got &quot;.$request-&gt;getBody().&quot;\n&quot;);
  });
  $socket = new \React\Socket\Server(8070, $loop);
  $server-&gt;listen($socket);
  
  $loop-&gt;run();
  </code></pre>
  <p>And a client who perform a single request:</p>
  <pre><code>$loop = React\EventLoop\Factory::create();
  $client = new React\Http\Browser($loop);
  
  
  $client-&gt;post(
      'http://localhost:8070',
      array(
          'Content-Type' =&gt; 'application/json'
      ),
      json_encode($_GET)
  )-&gt;then(function (ResponseInterface $response) {
      echo (string)$response-&gt;getBody();
  }, 'printf');
  
  $loop-&gt;run();
  </code></pre>
  <p>Is there any event which I can use to shutdown server after responding. I don't want to use <code>exit()</code>, because after shutdown I want to perform other tasks before true exit.</p>