PHP Trait Kraken\Channel\Record\RequestRecordStorage

Datei anzeigen Open project: kraken-php/framework

Protected Properties

Property Type Description
$reqs RequestRecord[]

Protected Methods

Method Description
addRequest ( string $pid, RequestRecord $request ) Add new RequestRecord to storage.
cancelRequest ( string $pid, Erro\Error | Exceptio\Exception | ThrowableProxy $ex ) Cancel RequestRecord if it exists that has protocol ID equal to $pid.
createRequest ( string $pid, callable $success = null, callable $failure = null, callable $cancel = null, float $timeout ) : RequestRecord Create RequestRecord.
existsRequest ( string $pid ) : boolean Check if RequestRecord with given protocol ID exists.
expireRequests ( ) Cancel overdue Requests.
getRequest ( string $pid ) : RequestRecord | null Return RequestRecord if it exists or null if it does not exist.
rejectRequest ( string $pid, Erro\Error | Exceptio\Exception | ThrowableProxy $ex ) Reject RequestRecord if it exists that has protocol ID equal to $pid.
resolveRequest ( string $pid, string $message ) Resolve RequestRecord if it exists that has protocol ID equal to $pid.

Method Details

addRequest() protected method

Add new RequestRecord to storage.
protected addRequest ( string $pid, RequestRecord $request )
$pid string
$request RequestRecord

cancelRequest() protected method

Cancel RequestRecord if it exists that has protocol ID equal to $pid.
protected cancelRequest ( string $pid, Erro\Error | Exceptio\Exception | ThrowableProxy $ex )
$pid string
$ex Erro\Error | Exceptio\Exception | Kraken\Throwable\ThrowableProxy

createRequest() protected method

Create RequestRecord.
protected createRequest ( string $pid, callable $success = null, callable $failure = null, callable $cancel = null, float $timeout ) : RequestRecord
$pid string
$success callable
$failure callable
$cancel callable
$timeout float
return RequestRecord

existsRequest() protected method

Check if RequestRecord with given protocol ID exists.
protected existsRequest ( string $pid ) : boolean
$pid string
return boolean

expireRequests() protected method

Cancel overdue Requests.
protected expireRequests ( )

getRequest() protected method

Return RequestRecord if it exists or null if it does not exist.
protected getRequest ( string $pid ) : RequestRecord | null
$pid string
return RequestRecord | null

rejectRequest() protected method

Reject RequestRecord if it exists that has protocol ID equal to $pid.
protected rejectRequest ( string $pid, Erro\Error | Exceptio\Exception | ThrowableProxy $ex )
$pid string
$ex Erro\Error | Exceptio\Exception | Kraken\Throwable\ThrowableProxy

resolveRequest() protected method

Resolve RequestRecord if it exists that has protocol ID equal to $pid.
protected resolveRequest ( string $pid, string $message )
$pid string
$message string

Property Details

$reqs protected_oe property

protected RequestRecord[],Kraken\Channel\Record $reqs
return RequestRecord[]