public function getOutput($type, InputMessageIdentifier $identifier)
 {
     $id = $identifier->getId();
     while (!isset($this->outputMessages[$id])) {
         $this->channel->wait();
     }
     $outputMessage = $this->outputMessages[$id];
     unset($this->outputMessages[$id]);
     return $outputMessage;
 }
 public function getOutput($type, InputMessageIdentifier $identifier)
 {
     return $this->storageOutput[$identifier->getId()];
 }
示例#3
0
 /**
  * @param string $type
  * @param InputMessageIdentifier $identifier
  * @return OutputMessage
  */
 public function getOutput($type, InputMessageIdentifier $identifier)
 {
     $messageId = $identifier->getId();
     $data = $this->redis->hGet($this->getMessageResultKey($type), $messageId);
     if (empty($data)) {
         return null;
     }
     do {
         $resultReady = $this->redis->blPop($this->getMessageResultReadyKey($type, $messageId), 1);
     } while (empty($resultReady));
     $data = $this->redis->hGet($this->getMessageResultKey($type), $messageId);
     $this->redis->hDel($this->getMessageResultKey($type), $messageId);
     return new OutputMessage($data);
 }