Exemplo n.º 1
0
    /**
     * @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();
        }
    }