Thruway\Role\Dealer::processYield PHP Method

processYield() private method

process YieldMessage
private processYield ( Session $session, Thruway\Message\YieldMessage $msg )
$session Thruway\Session
$msg Thruway\Message\YieldMessage
    private function processYield(Session $session, YieldMessage $msg)
    {
        /* @var $call Call */
        $call = isset($this->callInvocationIndex[$msg->getRequestId()]) ? $this->callInvocationIndex[$msg->getRequestId()] : null;
        if (!$call) {
            $session->sendMessage(ErrorMessage::createErrorMessageFromMessage($msg));
            Logger::error($this, "Received YieldMessage for non-existent call from " . $session->getSessionId());
            return;
        }
        $keepIndex = $call->processYield($session, $msg);
        if (!$keepIndex) {
            $this->removeCall($call);
        }
        /* @var $procedure \Thruway\Procedure */
        $procedure = isset($this->procedures[$call->getCallMessage()->getUri()]) ? $this->procedures[$call->getCallMessage()->getUri()] : null;
        if ($procedure && $procedure->getAllowMultipleRegistrations()) {
            $procedure->processQueue();
        }
        //Process queues on other registrations if we can take more requests
        if ($session->getPendingCallCount() == 0 && $this->registrationsBySession->contains($session)) {
            $this->processQueue($session);
        }
    }