Ejemplo n.º 1
0
 /**
  * @coroutine
  *
  * @return \Generator
  *
  * @throws \Icicle\Concurrent\Exception\StatusError If the process has not been started.
  */
 public function join() : \Generator
 {
     if (null === $this->delayed) {
         throw new StatusError('The process has not been started.');
     }
     $this->poll->listen();
     try {
         return (yield $this->delayed);
     } finally {
         $this->stdout->close();
         $this->stderr->close();
     }
 }
Ejemplo n.º 2
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();
        }
    }
Ejemplo n.º 3
0
 /**
  * {@inheritdoc}
  *
  * @param float|int $timeout Timeout for poll and await if a read or write was pending.
  */
 public function rebind(float $timeout = 0)
 {
     $this->readable->rebind($timeout);
     $this->writable->rebind($timeout);
 }