Class ResultPaginator
- Aws\ResultPaginator implements Iterator
- Namespace: Aws
- Located at ResultPaginator.php
Iterator that yields each page of results of a pageable operation.
Methods Summary
- __construct ( Aws\AwsClientInterface $client, string $operation, array $args, array $config )
-
each ( callable $handleResult )
Runs a paginator asynchronously and uses a callback to handle results.
-
search ( string $expression )
Returns an iterator that iterates over the values of applying a JMESPath search to each result yielded by the iterator as a flat sequence.
- current ( )
- key ( )
- next ( )
- valid ( )
- rewind ( )
Methods Details
__construct (
Aws\AwsClientInterface
$client,
string
$operation,
array
$args,
array
$config
)
Parameters
Aws\AwsClientInterface |
$client | |
string | $operation | |
array | $args | |
array | $config |
GuzzleHttp\Promise\Promise
each (
callable
$handleResult
)
Runs a paginator asynchronously and uses a callback to handle results.
The callback should have the signature: function (Aws\Result $result). A non-null return value from the callback will be yielded by the promise. This means that you can return promises from the callback that will need to be resolved before continuing iteration over the remaining items, essentially merging in other promises to the iteration. The last non-null value returned by the callback will be the result that fulfills the promise to any downstream promises.
Parameters
callable | $handleResult | Callback for handling each page of results. The callback accepts the result that was yielded as a single argument. If the callback returns a promise, the promise will be merged into the coroutine. |
Returns
GuzzleHttp\Promise\Promise |
Iterator search ( string $expression )
Returns an iterator that iterates over the values of applying a JMESPath search to each result yielded by the iterator as a flat sequence.
Parameters
string | $expression | JMESPath expression to apply to each result. |
Returns
Iterator |
current ( )
Implementation of
Iterator::current()
key ( )
Implementation of
Iterator::key()
next ( )
Implementation of
Iterator::next()
valid ( )
Implementation of
Iterator::valid()
rewind ( )
Implementation of
Iterator::rewind()