Waiter
in package
The waiter promise is always returned from every API call to a waiter.
Table of Contents
Constants
- STATE_FAILURE = 'failure'
- STATE_PENDING = 'pending'
- STATE_SUCCESS = 'success'
- WAIT_DELAY = 5.0
- WAIT_TIMEOUT = 30.0
Properties
- $awsClient : AbstractApi|null
- $input : object|null
- Input used to build the API request that generate this Waiter.
- $finalState : string|null
- $needRefresh : bool
- Whether or not a new response should be fetched.
- $resolved : bool
- $response : Response
Methods
- __construct() : mixed
- __destruct() : mixed
- cancel() : void
- getState() : string
- info() : ResponseInterface, status: int}
- Returns info on the current request.
- isFailure() : bool
- isPending() : bool
- isSuccess() : bool
- resolve() : bool
- Make sure the actual request is executed.
- wait() : bool
- Wait until the state is success.
- extractState() : string
- refreshState() : Waiter
- stealResponse() : void
Constants
STATE_FAILURE
public
mixed
STATE_FAILURE
= 'failure'
STATE_PENDING
public
mixed
STATE_PENDING
= 'pending'
STATE_SUCCESS
public
mixed
STATE_SUCCESS
= 'success'
WAIT_DELAY
protected
mixed
WAIT_DELAY
= 5.0
WAIT_TIMEOUT
protected
mixed
WAIT_TIMEOUT
= 30.0
Properties
$awsClient
protected
AbstractApi|null
$awsClient
$input
Input used to build the API request that generate this Waiter.
protected
object|null
$input
$finalState
private
string|null
$finalState
$needRefresh
Whether or not a new response should be fetched.
private
bool
$needRefresh
= false
$resolved
private
bool
$resolved
= false
$response
private
Response
$response
Methods
__construct()
public
__construct(Response $response, AbstractApi $awsClient, object|null $request) : mixed
Parameters
- $response : Response
- $awsClient : AbstractApi
- $request : object|null
__destruct()
public
__destruct() : mixed
cancel()
public
final cancel() : void
getState()
public
final getState() : string
Return values
stringinfo()
Returns info on the current request.
public
final info() : ResponseInterface, status: int}
Return values
ResponseInterface, status: int}isFailure()
public
final isFailure() : bool
Return values
boolisPending()
public
final isPending() : bool
Return values
boolisSuccess()
public
final isSuccess() : bool
Return values
boolresolve()
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 —false on timeout. True if the response has returned with as status code.
wait()
Wait until the state is success.
public
final wait([float $timeout = null ][, float $delay = null ]) : bool
Stopped when the state become Failure or the defined timeout is reached.
Parameters
- $timeout : float = null
-
Duration in seconds before aborting
- $delay : float = null
-
Duration in seconds between each check
Return values
bool —true if a final state was reached
extractState()
protected
extractState(Response $response, HttpException|null $exception) : string
Parameters
- $response : Response
- $exception : HttpException|null
Return values
stringrefreshState()
protected
refreshState() : Waiter
Return values
WaiterstealResponse()
private
stealResponse(self $waiter) : void
Parameters
- $waiter : self