Directus / @directus/memory / index / CacheMulti
Class: CacheMulti
Implements
Constructors
new CacheMulti(config)
new CacheMulti(
config
):CacheMulti
Parameters
• config: Omit
<CacheConfigMulti
, "type"
>
Returns
Source
packages/memory/src/cache/lib/multi.ts:27
Properties
bus
bus:
Bus
Source
packages/memory/src/cache/lib/multi.ts:25
local
local:
CacheLocal
Source
packages/memory/src/cache/lib/multi.ts:23
processId
processId:
string
Source
packages/memory/src/cache/lib/multi.ts:21
redis
redis:
CacheRedis
Source
packages/memory/src/cache/lib/multi.ts:24
Methods
clearOthers()
private
clearOthers(key
):Promise
<void
>
Parameters
• key: string
Returns
Promise
<void
>
Source
packages/memory/src/cache/lib/multi.ts:58
delete()
delete(
key
):Promise
<void
>
Remove the given key from the cache
Parameters
• key: string
Key to remove from the cache
Returns
Promise
<void
>
Implementation of
Source
packages/memory/src/cache/lib/multi.ts:49
get()
get<
T
>(key
):Promise
<undefined
|T
>
Get the cached value by key. Returns undefined if the key doesn't exist in the cache
Type parameters
• T = unknown
Parameters
• key: string
Key to retrieve from the cache
Returns
Promise
<undefined
| T
>
Cached value, or undefined if key doesn't exist
Implementation of
Source
packages/memory/src/cache/lib/multi.ts:34
has()
has(
key
):Promise
<boolean
>
Check if a given key exists in the cache
Parameters
• key: string
Key to check
Returns
Promise
<boolean
>
Implementation of
Source
packages/memory/src/cache/lib/multi.ts:54
onMessage()
private
onMessage(payload
):Promise
<void
>
Parameters
• payload: CacheMultiMessageClear
Returns
Promise
<void
>
Source
packages/memory/src/cache/lib/multi.ts:66
set()
set(
key
,value
):Promise
<void
>
Save the given value to the cache
Parameters
• key: string
Key to save in the cache
• value: unknown
Value to save to the cache. Can be any JavaScript primitive, plain object, or array
Returns
Promise
<void
>