ResultPaginator
in package
implements
Iterator
Iterator that yields each page of results of a pageable operation.
Table of Contents
Interfaces
- Iterator
Methods
- __construct() : mixed
- current() : Result
- each() : Promise
- Runs a paginator asynchronously and uses a callback to handle results.
- key() : mixed
- next() : void
- rewind() : void
- search() : Iterator
- Returns an iterator that iterates over the values of applying a JMESPath search to each result yielded by the iterator as a flat sequence.
- valid() : bool
Methods
__construct()
public
__construct(AwsClientInterface $client, string $operation, array<string|int, mixed> $args, array<string|int, mixed> $config) : mixed
Parameters
- $client : AwsClientInterface
- $operation : string
- $args : array<string|int, mixed>
- $config : array<string|int, mixed>
current()
public
current() : Result
Return values
Resulteach()
Runs a paginator asynchronously and uses a callback to handle results.
public
each(callable $handleResult) : Promise
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
- $handleResult : callable
-
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.
Return values
Promisekey()
public
key() : mixed
next()
public
next() : void
rewind()
public
rewind() : void
search()
Returns an iterator that iterates over the values of applying a JMESPath search to each result yielded by the iterator as a flat sequence.
public
search(string $expression) : Iterator
Parameters
- $expression : string
-
JMESPath expression to apply to each result.
Return values
Iteratorvalid()
public
valid() : bool