/** * @coroutine * * @return \Generator * * @throws \Icicle\Concurrent\Exception\StatusError If the process has not been started. */ public function join() { if (null === $this->promise) { throw new StatusError('The process has not been started.'); } $this->poll->reference(); try { yield $this->promise; } finally { $this->stdout->close(); $this->stderr->close(); } }
/** * {@inheritdoc} */ protected function createEvent(EventBase $base, SocketEventInterface $socket, callable $callback) : Event { return new Event($base, $socket->getResource(), Event::READ, $callback, $socket); }