本文整理汇总了PHP中Aws\Sqs\SqsClient::listQueues方法的典型用法代码示例。如果您正苦于以下问题:PHP SqsClient::listQueues方法的具体用法?PHP SqsClient::listQueues怎么用?PHP SqsClient::listQueues使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Aws\Sqs\SqsClient
的用法示例。
在下文中一共展示了SqsClient::listQueues方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: listQueues
/**
* @inheritdoc
*
* @throws QueueAccessException
*/
public function listQueues($prefix = '')
{
$listQueues = [];
try {
if (empty($prefix)) {
$results = $this->sqsClient->listQueues();
} else {
$results = $this->sqsClient->listQueues(['QueueNamePrefix' => $prefix]);
}
} catch (SqsException $e) {
throw new QueueAccessException('Cannot list queues', 0, $e);
}
$results = $results->get('QueueUrls');
foreach ($results as $result) {
$result = explode('/', $result);
$result = array_pop($result);
$priorities = $this->priorityHandler->getAll();
foreach ($priorities as $priority) {
if (!empty($priority)) {
$result = str_replace(static::PRIORITY_SEPARATOR . $priority->getName(), '', $result);
}
}
$listQueues[] = $result;
}
$listQueues = array_unique($listQueues);
return $listQueues;
}
示例2: listQueues
/**
* @inheritdoc
*
* @throws SqsException
*/
public function listQueues($prefix = '')
{
$listQueues = [];
if (empty($prefix)) {
$results = $this->sqsClient->listQueues();
} else {
$results = $this->sqsClient->listQueues(['QueueNamePrefix' => $prefix]);
}
$results = $results->get('QueueUrls');
foreach ($results as $result) {
$result = explode('/', $result);
$result = array_pop($result);
$priorities = $this->priorityHandler->getAll();
foreach ($priorities as $priority) {
if (!empty($priority)) {
$result = str_replace(static::PRIORITY_SEPARATOR . $priority, '', $result);
}
}
$listQueues[] = $result;
}
$listQueues = array_unique($listQueues);
return $listQueues;
}
示例3: getQueues
public function getQueues()
{
$response = $this->service->listQueues(array());
return $response->get('QueueUrls');
}
示例4: getUrls
/**
* @return array
*/
protected function getUrls()
{
$elements = $this->client->listQueues(['QueueNamePrefix' => $this->config->getQueueNamePrefix()]);
return $elements->getPath('QueueUrls') ?: [];
}