/** * @param ClientSession $session * @param ResultMessage $msg */ public function processResult(ClientSession $session, ResultMessage $msg) { if (isset($this->callRequests[$msg->getRequestId()])) { /* @var $futureResult Deferred */ $futureResult = $this->callRequests[$msg->getRequestId()]['future_result']; $futureResult->resolve($msg->getArguments()); unset($this->callRequests[$msg->getRequestId()]); } }
/** * Process ResultMessage * * @param \Thruway\Message\ResultMessage $msg */ protected function processResult(ResultMessage $msg) { if (isset($this->callRequests[$msg->getRequestId()])) { /* @var $futureResult Deferred */ $futureResult = $this->callRequests[$msg->getRequestId()]['future_result']; $callResult = new CallResult($msg); $details = $msg->getDetails(); if (is_array($details) && isset($details['progress']) && $details['progress']) { // TODO: what if we didn't want progress? $futureResult->progress($callResult); } else { $futureResult->resolve($callResult); unset($this->callRequests[$msg->getRequestId()]); } } }
/** * Constructor * * @param \Thruway\Message\ResultMessage $msg */ public function __construct(ResultMessage $msg) { $this->resultMessage = $msg; parent::__construct($msg->getArguments()); }