Exemple #1
0
 /**
  * Returns a message (response) related to the given message. This uses
  * the ActionID tag (key).
  *
  * @todo not suitable for multithreaded applications
  *
  * @return \Pastum\Component\PAMI\Message\IncomingMessage
  */
 protected function getRelated(OutgoingMessage $message)
 {
     $id = $message->getActionID('ActionID');
     if (isset($this->incomingQueue[$id])) {
         $response = $this->incomingQueue[$id];
         if ($response->isComplete()) {
             unset($this->incomingQueue[$id]);
             return $response;
         }
     }
     return null;
 }