CacheAdapter
Direct Subclass:
CacheAdapter base class.
Example:
API:
->get(arg_key:string, arg_default):Promise - get a cached value with its key.
->mget(arg_keys:array, arg_default:any|array):Promise - get cached values with their keys.
->has(arg_key:string):Promise - testif a cached value exists with given key.
->set(arg_key:string, arg_value, arg_ttl=undefined):Promise - set a cached value with its key and ttl.
->set_ttl(arg_key:string, arg_ttl):Promise - set cached value ttl.
->get_ttl(arg_key:string):Promise - get cached value ttl.
->get_keys():Promise - get all cached values keys.
->remove(arg_key:string|array):Promise - remove a cached value.
->flush():nothing - delete all entries.
->close():nothing - clear interval timeout for checks.
Constructor Summary
Public Constructor | ||
public |
constructor(arg_settings: object): nothing Create CacheAdapter instance to manage cached datas. |
Member Summary
Public Members | ||
public |
Class type flag. |
Method Summary
Public Methods | ||
public |
Close cache engine. |
|
public |
Flush all cached values (clear interval timeout for checks). |
|
public |
Get a cached value. |
|
public |
Get cached keys. |
|
public |
Get cached value ttl. |
|
public |
Test if given key has a cached value. |
|
public |
Get a cached value. |
|
public |
Remove a cached value. |
|
public |
Set a cached value with given key. |
|
public |
Set cached value ttl. |
Public Constructors
Public Methods
public get(arg_key: string, arg_default: any): Promise source
Get a cached value.
Params:
Name | Type | Attribute | Description |
arg_key | string | key string to retrieve the value. |
|
arg_default | any | returned default value if the key is not found (optional) (default:undefined). |
public get_ttl(arg_key: string): Promise source
Get cached value ttl.
Params:
Name | Type | Attribute | Description |
arg_key | string | key string to retrieve the value. |
public has(arg_key: string): Promise source
Test if given key has a cached value.
Params:
Name | Type | Attribute | Description |
arg_key | string | key string to retrieve the value. |
public mget(arg_keys: array, arg_default: any): Promise source
Get a cached value.
Params:
Name | Type | Attribute | Description |
arg_keys | array | key strings to retrieve the values. |
|
arg_default | any | returned default value if the key is not found (optional) (default:undefined). |
public remove(arg_keys: string | array): Promise source
Remove a cached value.
Params:
Name | Type | Attribute | Description |
arg_keys | string | array | value key string or array. |