class NoopStore
implements CacheStore
Since 0.1.0

No-op implementation of CacheStore. Every method resolves without side effects: reads return null/false, writes resolve void, and lifecycle methods are no-ops.

Constructors

NoopStore(_prefix?: string)

The prefix parameter is accepted for interface parity but unused.

Methods

clear(): Promise<void>

Remove all entries scoped to this backend's prefix.

The prefix is provided at construction time (not per-call), so each backend can scope the clear appropriately:

  • Redis: SCAN MATCH ${prefix}* + batch DEL
  • Memory: empty the internal map (each plugin instance owns its own map, so it naturally holds only this prefix's keys)
connect(): Promise<void>

Establish the backend connection (if applicable).

delete(_key: string): Promise<boolean>

Delete a value. The key is already-prefixed by CacheService.

disconnect(): Promise<void>

Gracefully disconnect.

get<T>(_key: string): Promise<T | null>

Read a value. The key is already-prefixed by CacheService.

has(_key: string): Promise<boolean>

Check existence. The key is already-prefixed by CacheService.

Since 0.5.0
isHealthy(): Promise<boolean>

Lifecycle truth (M90b): the no-op backend stores nothing, so the only honest reachability answer is whether the store is connected.

isReady(): boolean

Reports whether the backend is ready for operations.

set<T>(
_key: string,
_value: T,
_ttlSeconds?: number
): Promise<void>

Write a value. The key is already-prefixed by CacheService.

Usage

import { NoopStore } from "cache-plugin/src/index.ts";