Thruway\Role\Dealer::processCancel PHP Method

processCancel() private method

private processCancel ( Session $session, Thruway\Message\CancelMessage $msg )
$session Thruway\Session
$msg Thruway\Message\CancelMessage
    private function processCancel(Session $session, CancelMessage $msg)
    {
        $call = $this->getCallByRequestId($msg->getRequestId());
        if ($call && $call->getCallerSession() !== $session) {
            Logger::warning($this, "Attempt to cancel call by non-owner");
            return;
        }
        if (!$call) {
            $errorMsg = ErrorMessage::createErrorMessageFromMessage($msg);
            $errorMsg->setErrorURI("wamp.error.no_such_call");
            $session->sendMessage($errorMsg);
            Logger::error($this, "wamp.error.no_such_call");
            return;
        }
        if ($call->getInterruptMessage()) {
            $errorMsg = ErrorMessage::createErrorMessageFromMessage($msg);
            $errorMsg->setErrorURI("wamp.error.canceling");
            Logger::warning($this, "There was an attempt to cancel a message that is already in the process of being canceled");
            return;
        }
        $removeCall = $call->processCancel($session, $msg);
        if ($call->getInterruptMessage()) {
            $this->callInterruptIndex[$call->getInterruptMessage()->getRequestId()] = $call;
        }
        if ($removeCall) {
            $this->removeCall($call);
        }
    }