PHP Class Odesk\Phystrix\RequestCache

显示文件 Open project: odesk/phystrix Class Usage Examples

Protected Properties

Property Type Description
$cachedResults array Associative array of results per command key per cache key

Public Methods

Method Description
clear ( string $commandKey, string $cacheKey ) Clears the cache for a given cacheKey, for a given commandKey
clearAll ( string $commandKey ) Clears the cache for a given commandKey only
exists ( string $commandKey, string $cacheKey ) : boolean Returns true, if specified cache key exists
get ( string $commandKey, string $cacheKey ) : mixed | null Attempts to obtain cached result for a given command type
put ( string $commandKey, string $cacheKey, mixed $result ) Puts request result into cache for a given command type

Method Details

clear() public method

Clears the cache for a given cacheKey, for a given commandKey
public clear ( string $commandKey, string $cacheKey )
$commandKey string
$cacheKey string

clearAll() public method

Clears the cache for a given commandKey only
public clearAll ( string $commandKey )
$commandKey string

exists() public method

Returns true, if specified cache key exists
public exists ( string $commandKey, string $cacheKey ) : boolean
$commandKey string
$cacheKey string
return boolean

get() public method

Attempts to obtain cached result for a given command type
public get ( string $commandKey, string $cacheKey ) : mixed | null
$commandKey string
$cacheKey string
return mixed | null

put() public method

Puts request result into cache for a given command type
public put ( string $commandKey, string $cacheKey, mixed $result )
$commandKey string
$cacheKey string
$result mixed

Property Details

$cachedResults protected_oe property

Associative array of results per command key per cache key
protected array $cachedResults
return array