Skip to content

@nogoo9/mcp-server-cloud-fs / 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

StorageProvider

opts
syncDebounceMs

number

ttlMs

number

Returns

MemoryStore

Methods

clear()

clear(): Promise<void>

Defined in: cache/memory.ts:69

Returns

Promise<void>

Implementation of

CacheStore.clear


delete()

delete(cacheKey): Promise<void>

Defined in: cache/memory.ts:64

Parameters

cacheKey

string

Returns

Promise<void>

Implementation of

CacheStore.delete


dirtyEntries()

dirtyEntries(): string[]

Defined in: cache/memory.ts:60

Returns

string[]

Implementation of

CacheStore.dirtyEntries


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

CacheStore.flush


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

CacheStore.get


isDirty()

isDirty(cacheKey): boolean

Defined in: cache/memory.ts:56

Parameters

cacheKey

string

Returns

boolean

Implementation of

CacheStore.isDirty


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

ParsedRoot

key

string

Returns

void

Implementation of

CacheStore.markDirty


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>

Implementation of

CacheStore.set

Released under the PolyForm Shield 1.0.0 License.