@nogoo9/mcp-server-cloud-fs / cache/memory / MemoryStore
Class: MemoryStore
Defined in: cache/memory.ts:24
In-memory cache store with TTL expiry and debounced write-back.
All data is held in a Map and lost on process exit. Suitable for development, testing, and single-process deployments.
Implements
Constructors
Constructor
new MemoryStore(
provider,opts):MemoryStore
Defined in: cache/memory.ts:29
Parameters
provider
opts
syncDebounceMs
number
ttlMs
number
Returns
MemoryStore
Methods
clear()
clear():
Promise<void>
Defined in: cache/memory.ts:69
Returns
Promise<void>
Implementation of
delete()
delete(
cacheKey):Promise<void>
Defined in: cache/memory.ts:64
Parameters
cacheKey
string
Returns
Promise<void>
Implementation of
dirtyEntries()
dirtyEntries():
string[]
Defined in: cache/memory.ts:60
Returns
string[]
Implementation of
dispose()
dispose():
void
Defined in: cache/memory.ts:87
Cancels the debounce timer without flushing. Call in tests to avoid timer leaks.
Returns
void
flush()
flush():
Promise<void>
Defined in: cache/memory.ts:78
Cancels debounce timer; flushes all dirty entries to provider synchronously.
Returns
Promise<void>
Implementation of
get()
get(
cacheKey):Promise<Buffer<ArrayBufferLike> |null>
Defined in: cache/memory.ts:34
Returns null on cache miss or TTL expiry. Does NOT call the provider.
Parameters
cacheKey
string
Returns
Promise<Buffer<ArrayBufferLike> | null>
Implementation of
isDirty()
isDirty(
cacheKey):boolean
Defined in: cache/memory.ts:56
Parameters
cacheKey
string
Returns
boolean
Implementation of
markDirty()
markDirty(
cacheKey,root,key):void
Defined in: cache/memory.ts:51
Marks cacheKey dirty and records routing info for flush. Starts debounce timer.
Parameters
cacheKey
string
root
key
string
Returns
void
Implementation of
set()
set(
cacheKey,value):Promise<void>
Defined in: cache/memory.ts:44
Stores value with TTL; does NOT mark dirty.
Parameters
cacheKey
string
value
Buffer
Returns
Promise<void>
