Skip to content

@codesoul-co/hypha-adapters-local / in-memory-execution-cache-store

Using this module

Use the In memory execution cache store module for persisting and reading data at this boundary. It exports 2 classes, 2 interfaces.

Import from the package entrypoint

ts
import {
  InMemoryExecutionCacheStore,
  NodeExecutionFingerprintHasher,
} from '@codesoul-co/hypha-adapters-local';

import type {
  InMemoryExecutionCacheStoreOptions,
  InMemoryExecutionCacheStoreStats,
} from '@codesoul-co/hypha-adapters-local';

Usage patterns

  • Use the 2 type/interface exports as static contracts in application code, adapters, or tests. Import them with import type; they do not exist at runtime.
  • The module exposes 2 classes as constructable runtime implementations. Each symbol entry lists its constructor and public methods.

Public exports

SymbolKindSignatureDescription
InMemoryExecutionCacheStoreclassnew InMemoryExecutionCacheStore(options?: InMemoryExecutionCacheStoreOptions): InMemoryExecutionCacheStoreBounded local reference store. Durable or shared providers implement the same Core port.
NodeExecutionFingerprintHasherclassnew NodeExecutionFingerprintHasher(): NodeExecutionFingerprintHasherNode Execution Fingerprint Hasher class with 3 public constructor or member entries; its exact declarations are listed below.
InMemoryExecutionCacheStoreOptionsinterfaceinterface InMemoryExecutionCacheStoreOptionsIn Memory Execution Cache Store Options interface with 3 public fields or methods.
InMemoryExecutionCacheStoreStatsinterfaceinterface InMemoryExecutionCacheStoreStatsIn Memory Execution Cache Store Stats interface with 3 public fields or methods.

InMemoryExecutionCacheStore

Bounded local reference store. Durable or shared providers implement the same Core port.

Declaration

text
export declare class InMemoryExecutionCacheStore implements ExecutionCacheStore {
    constructor(options?: InMemoryExecutionCacheStoreOptions);
    get(key: string): Promise<ExecutionCacheRecord | null>;
    set(key: string, rawRecord: ExecutionCacheRecord): Promise<void>;
    delete(key: string): Promise<void>;
    clear(): Promise<void>;
    stats(): InMemoryExecutionCacheStoreStats;
}

Public members

MemberKindSignatureDescription
clearmethodclear(): Promise<void>Public method; parameters and return type are shown in the signature.
constructorconstructor(options?: InMemoryExecutionCacheStoreOptions): InMemoryExecutionCacheStoreCreates an instance of this class.
deletemethoddelete(key: string): Promise<void>Public method; parameters and return type are shown in the signature.
getmethodget(key: string): Promise<ExecutionCacheRecord | null>Public method; parameters and return type are shown in the signature.
setmethodset(key: string, rawRecord: ExecutionCacheRecord): Promise<void>Public method; parameters and return type are shown in the signature.
statsmethodstats(): InMemoryExecutionCacheStoreStatsPublic method; parameters and return type are shown in the signature.

NodeExecutionFingerprintHasher

Node Execution Fingerprint Hasher class with 3 public constructor or member entries; its exact declarations are listed below.

Declaration

text
export declare class NodeExecutionFingerprintHasher implements ExecutionFingerprintHasher {
    readonly algorithm: "sha256";
    hashUtf8(canonicalValue: string): Promise<string>;
}

Public members

MemberKindSignatureDescription
algorithmpropertyreadonly algorithm: "sha256"Public property; its type, readonly modifier and optionality are shown in the signature.
constructorconstructor(): NodeExecutionFingerprintHasherCreates an instance of this class.
hashUtf8methodhashUtf8(canonicalValue: string): Promise<string>Public method; parameters and return type are shown in the signature.

InMemoryExecutionCacheStoreOptions

In Memory Execution Cache Store Options interface with 3 public fields or methods.

  • Kind: interface
  • Import: import type { InMemoryExecutionCacheStoreOptions } from '@codesoul-co/hypha-adapters-local';
  • Source module: in-memory-execution-cache-store

Declaration

text
export interface InMemoryExecutionCacheStoreOptions {
    maxEntries?: number;
    maxBytes?: number;
    maxEntryBytes?: number;
}

Contract members

MemberKindSignatureDescription
maxBytespropertymaxBytes?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
maxEntriespropertymaxEntries?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
maxEntryBytespropertymaxEntryBytes?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.

InMemoryExecutionCacheStoreStats

In Memory Execution Cache Store Stats interface with 3 public fields or methods.

  • Kind: interface
  • Import: import type { InMemoryExecutionCacheStoreStats } from '@codesoul-co/hypha-adapters-local';
  • Source module: in-memory-execution-cache-store

Declaration

text
export interface InMemoryExecutionCacheStoreStats {
    entries: number;
    sizeBytes: number;
    evictions: number;
}

Contract members

MemberKindSignatureDescription
entriespropertyentries: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
evictionspropertyevictions: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
sizeBytespropertysizeBytes: numberPublic property; its type, readonly modifier and optionality are shown in the signature.