Amazon AWS SDK Przewodnik Instalacji Strona 47

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 151
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 46
'VaultExists' => array(
'extends' => '__VaultState',
'success.type' => 'output',
'description' => 'Wait until a vault can be accessed.',
'ignore_errors' => array(
'ResourceNotFoundException',
),
),
'VaultNotExists' => array(
'extends' => '__VaultState',
'description' => 'Wait until a vault is deleted.',
'success.type' => 'error',
'success.value' => 'ResourceNotFoundException',
),
),
// ...
);
In order for you to contribute waiters to the SDK, you will need to implement them using the waiters DSL. The DSL is
not documented yet, since it is currently subject to change, so if you are interested in helping to implement more
waiters, please reach out to us via GitHub.
Iterators
Introduction
Some AWS operations return truncated results that require subsequent requests in order to retrieve the entire result
set. The subsequent requests typically require pagination tokens or markers from the previous request in order to
retrieve the next set of results. Working with these tokens can be cumbersome, since you must manually keep track
of them, and the API for each service may differ in how it uses them.
The AWS SDK for PHP has a feature called iterators that allow you to retrieve an entire result set without manually
handling pagination tokens or markers. The iterators in the SDK implement PHP's Iterator interface, which
allows you to easily enumerate or iterate through resources from a result set with foreach.
You can find a list of the iterators supported by a client by viewing the docblock of a client. Any @method tag that
has a name that looks like "get[…]Iterator" will return an iterator. For example, the following code uses the
getListObjectsIterator() method of the S3 client object to create an iterator for objects in a bucket.
$iterator = $client->getListObjectsIterator(array('Bucket' => 'my-bucket'));
foreach ($iterator as $object) {
echo $object['Key'] . "\n";
}
The "get[…]Iterator" methods are all implemented via the __call magic method, and are a more discoverable
shortcut to using the concrete getIterator() method, since many IDEs can auto-complete methods defined
using the @method annotation. The following code uses the getIterator() method, but is equivalent to the
previous code sample.
$iterator = $client->getIterator('ListObjects', array('Bucket' => 'my-bucket'));
foreach ($iterator as $object) {
echo $object['Key'] . "\n";
}
The getIterator() method also accepts a command object for the first argument. If you have a command object
already instantiated, you can create an iterator directly from the command object.
$command = $client->getCommand('ListObjects', array('Bucket' => 'my-bucket'));
$iterator = $client->getIterator($command);
Iterators
35
Przeglądanie stron 46
1 2 ... 42 43 44 45 46 47 48 49 50 51 52 ... 150 151

Komentarze do niniejszej Instrukcji

Brak uwag

Therma-Tru Para Casa manuales de usuario

Empezando en A

Haga clic en el alfabeto a continuación para desplazarse a la lista completa de modelos que comienzan con esa letra

Modelos Tipo de documento
ARCH 1 Dimensional Data - Book Size
Manual de usuario   Therma-Tru ARCH 1 Dimensional Data - Book Size User Manual, 76 paginas
ARCH 1 Dimensional Data - U1 Revised
Manual de usuario   Therma-Tru ARCH 1 Dimensional Data - U1 Revised User Manual, 70 paginas
ARCH 2 Architectural Details - Book Size
Manual de usuario   Therma-Tru ARCH 2 Architectural Details - Book Size User Manual, 99 paginas
ARCH 2 Architectural Details - U1 Revised
Manual de usuario   Therma-Tru ARCH 2 Architectural Details - U1 Revised User Manual, 98 paginas