Пример #1
0
 /**
  * @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()]);
     }
 }
Пример #2
0
 /**
  * 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()]);
         }
     }
 }
Пример #3
0
 /**
  * Constructor
  *
  * @param \Thruway\Message\ResultMessage $msg
  */
 public function __construct(ResultMessage $msg)
 {
     $this->resultMessage = $msg;
     parent::__construct($msg->getArguments());
 }