Thruway\Call::processYield PHP Method

processYield() public method

Process Yield message
public processYield ( Session $session, Thruway\Message\YieldMessage $msg ) : boolean
$session Session
$msg Thruway\Message\YieldMessage
return boolean if we need to keep the call indexed
    public function processYield(Session $session, YieldMessage $msg)
    {
        $keepIndex = true;
        $details = new \stdClass();
        $yieldOptions = $msg->getOptions();
        if (is_object($yieldOptions) && isset($yieldOptions->progress) && $yieldOptions->progress) {
            if ($this->isProgressive()) {
                $details->progress = true;
            } else {
                // not sure what to do here - just going to drop progress
                // if we are getting progress messages that the caller didn't ask for
                return $keepIndex;
            }
        } else {
            $this->getRegistration()->removeCall($this);
            $keepIndex = false;
        }
        $resultMessage = new ResultMessage($this->getCallMessage()->getRequestId(), $details, $msg->getArguments(), $msg->getArgumentsKw());
        $this->getCallerSession()->sendMessage($resultMessage);
        return $keepIndex;
    }