Icicle\Concurrent\Sync\Channel::receive PHP Method

receive() public method

public receive ( ) : Generator
return Generator
    public function receive() : \Generator;

Usage Example

Esempio n. 1
0
 /**
  * {@inheritdoc}
  */
 public function receive() : \Generator
 {
     if (null === $this->channel) {
         throw new StatusError('The process has not been started.');
     }
     $data = (yield from $this->channel->receive());
     if ($data instanceof ExitStatus) {
         $data = $data->getResult();
         throw new SynchronizationError(sprintf('Thread unexpectedly exited with result of type: %s', is_object($data) ? get_class($data) : gettype($data)));
     }
     return $data;
 }
All Usage Examples Of Icicle\Concurrent\Sync\Channel::receive