ResultPaginator
in package
implements
Iterator
Iterator that yields each page of results of a pageable operation.
Interfaces, Classes and Traits
- Iterator
Table of Contents
- $args : array<string|int, mixed>
- $client : AwsClientInterface
- $config : array<string|int, mixed>
- $nextToken : string|array<string|int, mixed>
- $operation : string
- $requestCount : int
- $result : Result
- __construct() : mixed
- current() : Result
- each() : Promise
- Runs a paginator asynchronously and uses a callback to handle results.
- key() : mixed
- next() : mixed
- rewind() : mixed
- 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() : mixed
- createNextCommand() : mixed
- determineNextToken() : mixed
Properties
$args
private
array<string|int, mixed>
$args
Args for the operation.
$client
private
AwsClientInterface
$client
Client performing operations.
$config
private
array<string|int, mixed>
$config
Configuration for the paginator.
$nextToken
private
string|array<string|int, mixed>
$nextToken
Next token to use for pagination.
$operation
private
string
$operation
Name of the operation being paginated.
$requestCount
private
int
$requestCount
= 0
Number of operations/requests performed.
$result
private
Result
$result
Most recent result from the client.
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>
Return values
mixed —current()
public
current() : Result
Return values
Result —each()
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
Promise —key()
public
key() : mixed
Return values
mixed —next()
public
next() : mixed
Return values
mixed —rewind()
public
rewind() : mixed
Return values
mixed —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
Iterator —valid()
public
valid() : mixed
Return values
mixed —createNextCommand()
private
createNextCommand(array<string|int, mixed> $args[, array<string|int, mixed> $nextToken = null ]) : mixed
Parameters
- $args : array<string|int, mixed>
- $nextToken : array<string|int, mixed> = null
Return values
mixed —determineNextToken()
private
determineNextToken(Result $result) : mixed
Parameters
- $result : Result