code: public function wait()
      {
          $this->internalWait();
          $event = $this->isSuccessExit()
              ? 'success'
              : 'error';
  
          $this->internalEmit('exit', $this->pid);
          $this->internalEmit($event);
  
          return $this;
      }
docs: Suspends execution of the current process until a child has exited.
  
  @return $this