示例#1
0
  /**
   * Peek at the messages from the specified queue without removing them.
   *
   * @param  string $queueId
   * @param  int $num How many messages
   * @param  array  $options
   * @return \Zend\Cloud\QueueService\Message[]
   */
  public function peekMessages($queueId, $num = 1, $options = null)
  {
      try {
          if ($queueId instanceof \Zend\Service\WindowsAzure\Storage\QueueInstance) {
              $queueId = $queueId->Name;
          }
          return $this->_makeMessages($this->_storageClient->peekMessages($queueId, $num));
      } catch (WindowsAzureException\ExceptionInterface $e) {
          throw new Exception\RuntimeException('Error on peeking messages: '.$e->getMessage(), $e->getCode(), $e);
      }
 }