当前位置: 首页>>代码示例>>PHP>>正文


PHP SqsClient::deleteQueue方法代码示例

本文整理汇总了PHP中Aws\Sqs\SqsClient::deleteQueue方法的典型用法代码示例。如果您正苦于以下问题:PHP SqsClient::deleteQueue方法的具体用法?PHP SqsClient::deleteQueue怎么用?PHP SqsClient::deleteQueue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Aws\Sqs\SqsClient的用法示例。


在下文中一共展示了SqsClient::deleteQueue方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testCreateQueue

 public function testCreateQueue()
 {
     $queueName = 'test_queue';
     $db = DriverManager::getConnection(['driver' => 'pdo_mysql', 'host' => SYRUP_DATABASE_HOST, 'dbname' => SYRUP_DATABASE_NAME, 'user' => SYRUP_DATABASE_USER, 'password' => SYRUP_DATABASE_PASSWORD, 'port' => SYRUP_DATABASE_PORT]);
     $db->query("DELETE FROM queues WHERE id='{$queueName}'")->execute();
     $command = $this->application->find('syrup:queue:create');
     $commandTester = new CommandTester($command);
     $commandTester->execute(['name' => $queueName, '--register' => null, '--no-watch' => null]);
     $this->assertEquals(0, $commandTester->getStatusCode());
     $factory = new QueueFactory($db, ['db_table' => 'queues'], SYRUP_APP_NAME);
     $dbQueue = $factory->get($queueName);
     $queueUrlArr = explode('/', $dbQueue->getUrl());
     $this->assertEquals($queueName, array_pop($queueUrlArr));
     $sqsClient = new SqsClient(['version' => '2012-11-05', 'region' => 'us-east-1']);
     $sqsClient->deleteQueue(['QueueUrl' => $dbQueue->getUrl()]);
 }
开发者ID:ErikZigo,项目名称:syrup,代码行数:16,代码来源:QueueCreateCommandTest.php

示例2: testCreate

 public function testCreate()
 {
     $db = DriverManager::getConnection(['driver' => 'pdo_mysql', 'host' => SYRUP_DATABASE_HOST, 'dbname' => SYRUP_DATABASE_NAME, 'user' => SYRUP_DATABASE_USER, 'password' => SYRUP_DATABASE_PASSWORD, 'port' => SYRUP_DATABASE_PORT]);
     $factory = new QueueFactory($db, ['db_table' => 'queues'], SYRUP_APP_NAME);
     $sqsQueue = $factory->create('test');
     $queueUrlArr = explode('/', $sqsQueue->get('QueueUrl'));
     $this->assertEquals('test', array_pop($queueUrlArr));
     // delete the queue from AWS
     $sqsClient = new SqsClient(['version' => '2012-11-05', 'region' => 'us-east-1']);
     $sqsClient->deleteQueue(['QueueUrl' => $sqsQueue->get('QueueUrl')]);
 }
开发者ID:ErikZigo,项目名称:syrup,代码行数:11,代码来源:QueueFactoryTest.php

示例3: remove

 /**
  * {@inheritDoc}
  */
 public function remove(QueueAdapterInterface $queue)
 {
     if (!$queue instanceof SqsQueue) {
         throw new InvalidArgumentException('expecting an instance of SqsQueue');
     }
     try {
         $this->client->deleteQueue(['QueueUrl' => $queue->getUrl()]);
     } catch (\Exception $ex) {
         throw new RuntimeException($ex->getMessage(), $ex->getCode(), $ex);
     }
 }
开发者ID:ronan-gloo,项目名称:qu,代码行数:14,代码来源:SqsQueueManager.php

示例4: deleteQueue

 /**
  * @inheritdoc
  *
  * @throws SqsException
  */
 public function deleteQueue($queueName)
 {
     if (empty($queueName)) {
         throw new InvalidArgumentException('Parameter queueName empty or not defined.');
     }
     $priorities = $this->priorityHandler->getAll();
     foreach ($priorities as $priority) {
         $queueUrl = $this->sqsClient->getQueueUrl(['QueueName' => $this->getQueueNameWithPrioritySuffix($queueName, $priority)])->get('QueueUrl');
         $this->sqsClient->deleteQueue(['QueueUrl' => $queueUrl]);
     }
     return $this;
 }
开发者ID:bobey,项目名称:queue-client,代码行数:17,代码来源:SQSAdapter.php

示例5: deleteQueue

 /**
  * @inheritdoc
  *
  * @throws \InvalidArgumentException
  * @throws QueueAccessException
  */
 public function deleteQueue($queueName)
 {
     if (empty($queueName)) {
         throw new \InvalidArgumentException('Queue name empty or not defined.');
     }
     $priorities = $this->priorityHandler->getAll();
     foreach ($priorities as $priority) {
         try {
             $queueUrl = $this->sqsClient->getQueueUrl(['QueueName' => $this->getQueueNameWithPrioritySuffix($queueName, $priority)])->get('QueueUrl');
             $this->sqsClient->deleteQueue(['QueueUrl' => $queueUrl]);
         } catch (SqsException $e) {
             throw new QueueAccessException('Cannot delete queue.', 0, $e);
         }
     }
     return $this;
 }
开发者ID:ReputationVIP,项目名称:queue-client,代码行数:22,代码来源:SQSAdapter.php

示例6: destroy

 /**
  * @return Boolean
  */
 public function destroy()
 {
     $key = $this->getNameWithPrefix() . '_url';
     $this->cache->delete($key);
     if ($this->queueExists()) {
         // Delete the SQS Queue
         $this->sqs->deleteQueue(['QueueUrl' => $this->queueUrl]);
         $this->log(200, "SQS Queue removed", ['QueueUrl' => $this->queueUrl]);
     }
     $key = $this->getNameWithPrefix() . '_arn';
     $this->cache->delete($key);
     if ($this->topicExists() || !empty($this->queueUrl)) {
         // Delete the SNS Topic
         $topicArn = !empty($this->topicArn) ? $this->topicArn : str_replace('sqs', 'sns', $this->queueUrl);
         $this->sns->deleteTopic(['TopicArn' => $topicArn]);
         $this->log(200, "SNS Topic removed", ['TopicArn' => $topicArn]);
     }
     return true;
 }
开发者ID:uecode,项目名称:qpush-bundle,代码行数:22,代码来源:AwsProvider.php

示例7: deleteQueue

 /**
  * {@inheritDoc}
  */
 public function deleteQueue($queueId = null)
 {
     $queueUrl = $this->getQueueUrl($queueId);
     $this->queueClient->deleteQueue(["QueueUrl" => $queueUrl]);
 }
开发者ID:silktide,项目名称:queueball-sqs,代码行数:8,代码来源:Queue.php

示例8: deleteQueue

 public function deleteQueue()
 {
     $args = ["QueueUrl" => $this->getQueueUrl()];
     $this->client->deleteQueue($args);
 }
开发者ID:oasmobile,项目名称:php-aws-wrappers,代码行数:5,代码来源:SqsQueue.php


注:本文中的Aws\Sqs\SqsClient::deleteQueue方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。