Home > @imqueue/rpc > RedisCache
RedisCache class
Class RedisCache. Implements a cache engine on top of Redis.
Signature:
export declare class RedisCache implements ICache
Implements: ICache
Properties
|
Property |
Modifiers |
Type |
Description |
|---|---|---|---|
|
string | |||
|
boolean |
Methods
|
Method |
Modifiers |
Description |
|---|---|---|
|
Removes the value stored in the cache under the given key. | ||
|
|
Safely destroys the Redis connection. | |
|
Returns the value stored in the cache under a given key. | ||
|
Initializes the cache instance. The underlying Redis connection is shared between all instances; concurrent initializations share a single connection attempt. | ||
|
Purges all keys from the cache matching a given wildcard mask. | ||
|
Stores the given value in the cache under the given key. If TTL is specified, the cached value will expire after the given number of milliseconds. If the NX argument is set to true, the key:value pair is created only if it does not exist yet. The given value can be any JSON-compatible object and will be serialized automatically. |