Result
in package
Base class for all return values from a Api Client methods.
Example: FooClient::bar(): Result
.
Table of Contents
Properties
- $awsClient : AbstractApi|null
- $input : object|null
- Input used to build the API request that generate this Result.
- $initialized : bool
- $prefetchResults : array<string|int, self>
- $response : Response
Methods
- __construct() : mixed
- __destruct() : mixed
- cancel() : void
- info() : ResponseInterface, status: int}
- Returns info on the current request.
- resolve() : bool
- Make sure the actual request is executed.
- wait() : iterable<string|int, self>
- Make sure all provided requests are executed.
- initialize() : void
- populateResult() : void
- registerPrefetch() : void
- unregisterPrefetch() : void
Properties
$awsClient
protected
AbstractApi|null
$awsClient
$input
Input used to build the API request that generate this Result.
protected
object|null
$input
$initialized
private
bool
$initialized
= false
$prefetchResults
private
array<string|int, self>
$prefetchResults
= []
$response
private
Response
$response
Methods
__construct()
public
__construct(Response $response[, AbstractApi|null $awsClient = null ][, object|null $request = null ]) : mixed
Parameters
- $response : Response
- $awsClient : AbstractApi|null = null
- $request : object|null = null
__destruct()
public
__destruct() : mixed
cancel()
public
final cancel() : void
info()
Returns info on the current request.
public
final info() : ResponseInterface, status: int}
Return values
ResponseInterface, status: int}resolve()
Make sure the actual request is executed.
public
final resolve([float|null $timeout = null ]) : bool
Parameters
- $timeout : float|null = null
-
Duration in seconds before aborting. When null wait until the end of execution.
Tags
Return values
bool —whether the request is executed or not
wait()
Make sure all provided requests are executed.
public
final static wait(array<string|int, self> $results[, float|null $timeout = null ][, bool $downloadBody = false ]) : iterable<string|int, self>
This only work if the http responses are produced by the same HTTP client. See https://symfony.com/doc/current/components/http_client.html#multiplexing-responses.
Parameters
- $results : array<string|int, self>
- $timeout : float|null = null
-
Duration in seconds before aborting. When null wait until the end of execution. Using 0 means non-blocking
- $downloadBody : bool = false
-
Wait until receiving the entire response body or only the first bytes
Tags
Return values
iterable<string|int, self>initialize()
protected
final initialize() : void
populateResult()
protected
populateResult(Response $response) : void
Parameters
- $response : Response
registerPrefetch()
protected
final registerPrefetch(self $result) : void
Parameters
- $result : self
unregisterPrefetch()
protected
final unregisterPrefetch(self $result) : void
Parameters
- $result : self