protected function handleReceiveResponse(ProtocolInterface $protocol)
{
$pid = $protocol->getPid();
if (!$this->existsRequest($pid)) {
return false;
}
$message = $protocol->getMessage();
$exception = $protocol->getException();
if ($exception === '') {
$this->resolveRequest($pid, $message);
} else {
if ($exception === TaskIncompleteException::class) {
$this->cancelRequest($pid, new ThrowableProxy([$exception, $message]));
} else {
$this->rejectRequest($pid, new ThrowableProxy([$exception, $message]));
}
}
return true;
}