當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。