code: public function wait($unwrap = true)
      {
          $loop = $this->loop;
          while (HttpPromise::PENDING === $this->getState()) {
              $loop->futureTick(function () use ($loop) {
                  $loop->stop();
              });
              $loop->run();
          }
  
          if ($unwrap) {
              if (HttpPromise::REJECTED == $this->getState()) {
                  throw $this->exception;
              }
  
              return $this->response;
          }
      }
docs: {@inheritdoc}