@codesoul-co/hypha-serving-cache / stores/memory-store
- Package index:
@codesoul-co/hypha-serving-cache - Source:
packages/serving-cache/src/stores/memory-store.ts - Exports: 2
Using this module
Use the Memory store module for persisting and reading data at this boundary. It exports 2 classes.
Import from the package entrypoint
ts
import {
MemoryCacheStore,
NoopCacheStore,
} from '@codesoul-co/hypha-serving-cache';Usage patterns
- The module exposes 2 classes as constructable runtime implementations. Each symbol entry lists its constructor and public methods.
Public exports
| Symbol | Kind | Signature | Description |
|---|---|---|---|
MemoryCacheStore | class | new MemoryCacheStore(options?: { maxEntries?: number; maxBytes?: number; }): MemoryCacheStore | Memory Cache Store class with 8 public constructor or member entries; its exact declarations are listed below. |
NoopCacheStore | class | new NoopCacheStore(): NoopCacheStore | Noop Cache Store class with 5 public constructor or member entries; its exact declarations are listed below. |
MemoryCacheStore
Memory Cache Store class with 8 public constructor or member entries; its exact declarations are listed below.
- Kind: class
- Import:
import { MemoryCacheStore } from '@codesoul-co/hypha-serving-cache'; - Source module:
stores/memory-store
Declaration
text
export declare class MemoryCacheStore implements CacheStore {
constructor(options?: {
maxEntries?: number;
maxBytes?: number;
});
get<T>(key: string): Promise<CacheEntry<T> | null>;
set<T>(key: string, entry: CacheEntry<T>): Promise<void>;
delete(key: string): Promise<void>;
clear(): Promise<void>;
touch(key: string): Promise<void>;
stats(): Promise<CacheStoreStats>;
health(): Promise<CacheStoreHealth>;
}Public members
| Member | Kind | Signature | Description |
|---|---|---|---|
clear | method | clear(): Promise<void> | Public method; parameters and return type are shown in the signature. |
constructor | constructor | (options?: { maxEntries?: number; maxBytes?: number; }): MemoryCacheStore | Creates an instance of this class. |
delete | method | delete(key: string): Promise<void> | Public method; parameters and return type are shown in the signature. |
get | method | get<T>(key: string): Promise<CacheEntry<T> | null> | Public method; parameters and return type are shown in the signature. |
health | method | health(): Promise<CacheStoreHealth> | Public method; parameters and return type are shown in the signature. |
set | method | set<T>(key: string, entry: CacheEntry<T>): Promise<void> | Public method; parameters and return type are shown in the signature. |
stats | method | stats(): Promise<CacheStoreStats> | Public method; parameters and return type are shown in the signature. |
touch | method | touch(key: string): Promise<void> | Public method; parameters and return type are shown in the signature. |
NoopCacheStore
Noop Cache Store class with 5 public constructor or member entries; its exact declarations are listed below.
- Kind: class
- Import:
import { NoopCacheStore } from '@codesoul-co/hypha-serving-cache'; - Source module:
stores/memory-store
Declaration
text
export declare class NoopCacheStore implements CacheStore {
get<T>(): Promise<CacheEntry<T> | null>;
set<T>(): Promise<void>;
delete(): Promise<void>;
clear(): Promise<void>;
}Public members
| Member | Kind | Signature | Description |
|---|---|---|---|
clear | method | clear(): Promise<void> | Public method; parameters and return type are shown in the signature. |
constructor | constructor | (): NoopCacheStore | Creates an instance of this class. |
delete | method | delete(): Promise<void> | Public method; parameters and return type are shown in the signature. |
get | method | get<T>(): Promise<CacheEntry<T> | null> | Public method; parameters and return type are shown in the signature. |
set | method | set<T>(): Promise<void> | Public method; parameters and return type are shown in the signature. |
