HumHub Documentation (unofficial)

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

$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

Methods

__destruct()

public __destruct() : mixed

cancel()

public final cancel() : void

getState()

public final getState() : string
Return values
string

info()

Returns info on the current request.

public final info() : ResponseInterface, status: int}
Return values
ResponseInterface, status: int}

isFailure()

public final isFailure() : bool
Return values
bool

isPending()

public final isPending() : bool
Return values
bool

isSuccess()

public final isSuccess() : bool
Return values
bool

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
throws
NetworkException
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

stealResponse()

private stealResponse(self $waiter) : void
Parameters
$waiter : self

        
On this page

Search results