本文整理匯總了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') ?: [];
}