/**
* {@inheritdoc}
*/
public function join()
{
if (null === $this->channel) {
throw new StatusError('The process has not been started.');
}
$response = (yield $this->channel->receive());
yield $this->process->join();
if (!$response instanceof ExitStatusInterface) {
throw new SynchronizationError('Did not receive an exit status from thread.');
}
yield $response->getResult();
}