示例#1
0
 /**
  * Process RegisteredMessage
  *
  * @param \Thruway\Message\RegisteredMessage $msg
  * @return void
  */
 protected function processRegistered(RegisteredMessage $msg)
 {
     foreach ($this->registrations as $key => $registration) {
         if ($registration["request_id"] === $msg->getRequestId()) {
             Logger::info($this, "Setting registration_id for " . $registration['procedure_name'] . " (" . $key . ")");
             $this->registrations[$key]['registration_id'] = $msg->getRegistrationId();
             if ($this->registrations[$key]['futureResult'] instanceof Deferred) {
                 /* @var $futureResult \React\Promise\Deferred */
                 $futureResult = $this->registrations[$key]['futureResult'];
                 $futureResult->resolve();
             }
             return;
         }
     }
     Logger::error($this, "Got a Registered Message, but the request ids don't match");
 }
示例#2
0
 /**
  * @param ClientSession $session
  * @param RegisteredMessage $msg
  */
 public function processRegistered(ClientSession $session, RegisteredMessage $msg)
 {
     foreach ($this->registrations as $key => $registration) {
         if ($registration["request_id"] === $msg->getRequestId()) {
             $this->logger->info("---Setting registration_id for " . $registration['procedure_name'] . " (" . $key . ")\n");
             $this->registrations[$key]['registration_id'] = $msg->getRegistrationId();
             if ($this->registrations[$key]['futureResult'] instanceof Deferred) {
                 /** @var Deferred $futureResult */
                 $futureResult = $this->registrations[$key]['futureResult'];
                 $futureResult->resolve();
             }
             return;
         }
     }
     $this->logger->error("---Got a Registered Message, but the request ids don't match\n");
 }