Example #1
0
 /**
  * Listen to a server request
  *
  * @param callable $terminate
  */
 public function listen(callable $terminate = null)
 {
     $this->app->setExceptionRunner(new Runner($this->app, $this->getEmitter(), $this->getExceptionHandlers(), $this->getExceptionFormatter()));
     $this->app->setContext($this->getName());
     $this->app->bootstrap();
     try {
         $this->handle($terminate);
     } catch (Throwable $e) {
         $this->app->getExceptionRunner()->handleException($e);
     }
 }