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


PHP DynamoDbClient::waitUntil方法代码示例

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


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

示例1: deleteTable

 /**
  * Delete the table
  *
  * @param boolean $wait  Wait until the table is deleted
  */
 protected static function deleteTable($wait = false)
 {
     self::$dynamodb->deleteTable(['TableName' => self::TABLE_NAME]);
     if (!$wait) {
         return;
     }
     self::$dynamodb->waitUntil('TableNotExists', ['TableName' => self::TABLE_NAME, 'waiter.interval' => 1, 'waiter.max_attempts' => 5]);
 }
开发者ID:sven4ask,项目名称:config,代码行数:13,代码来源:DynamoDBLoaderTest.php

示例2: execute

 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $this->dynamoDbClient = $this->getContainer()->get('queue.dynamodb_client');
     $this->tableName = $this->getContainer()->getParameter('container_stats_dynamodb.table_name');
     try {
         $this->dynamoDbClient->describeTable(['TableName' => $this->tableName]);
         echo 'Table ' . $this->tableName . ' already exists.' . "\n";
     } catch (DynamoDbException $e) {
         if (strpos($e->getMessage(), 'ResourceNotFoundException') !== false) {
             echo 'Creating ' . $this->tableName . ' table ...';
             $this->dynamoDbClient->createTable($this->getTableConfiguration());
             $this->dynamoDbClient->waitUntil('TableExists', ['TableName' => $this->tableName, '@waiter' => ['delay' => 3, 'maxAttempts' => 20]]);
             echo ' done!' . "\n";
         } else {
             throw $e;
         }
     }
 }
开发者ID:keboola,项目名称:syrup-queue,代码行数:18,代码来源:MetricsInitTableCommand.php

示例3: testUpdatesTable

 /**
  * @depends testCreatesTable
  */
 public function testUpdatesTable()
 {
     self::log('Updating table');
     // Need to wait until the table is active
     $this->client->waitUntil('TableExists', $this->table, array('status' => 'active'));
     $this->client->updateTable(array('TableName' => $this->table, 'ProvisionedThroughput' => array('ReadCapacityUnits' => 20, 'WriteCapacityUnits' => 20)));
     // Wait until the table is active
     self::log('Waiting for the table to become active after updating');
     $this->client->waitUntil('table_exists', $this->table, array('status' => 'ACTIVE'));
     // Ensure the table is updated
     $result = $this->client->describeTable(array('TableName' => $this->table));
     // Ensure that the updates took effect
     $this->assertEquals(20, $result['Table']['ProvisionedThroughput']['ReadCapacityUnits']);
     $this->assertEquals(20, $result['Table']['ProvisionedThroughput']['WriteCapacityUnits']);
 }
开发者ID:romainneutron,项目名称:aws-sdk-php,代码行数:18,代码来源:IntegrationTest.php

示例4: deleteTable

 /**
  * Delete the test table after tests complete.
  */
 protected static function deleteTable()
 {
     self::$client->deleteTable(['TableName' => self::$tableName]);
     self::$client->waitUntil('TableNotExists', ['TableName' => self::$tableName]);
 }
开发者ID:gdbots,项目名称:pbj-php,代码行数:8,代码来源:DynamoDbTest.php


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