Skip to content

@codesoul-co/hypha-adapters-local / redis-execution-cache-store

Using this module

Use the Redis execution cache store module for persisting and reading data at this boundary. It exports 1 class, 2 interfaces.

Import from the package entrypoint

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

import type {
  RedisExecutionCacheStoreOptions,
  RedisLikeExecutionCacheClient,
} 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 1 class as constructable runtime implementations. Each symbol entry lists its constructor and public methods.

Public exports

SymbolKindSignatureDescription
RedisExecutionCacheStoreclassnew RedisExecutionCacheStore(options: RedisExecutionCacheStoreOptions): RedisExecutionCacheStoreKey-bound shared Execution Cache Store. The client port can wrap local, self-hosted, or managed Redis without exposing a Redis SDK to Core.
RedisExecutionCacheStoreOptionsinterfaceinterface RedisExecutionCacheStoreOptionsRedis Execution Cache Store Options interface with 5 public fields or methods.
RedisLikeExecutionCacheClientinterfaceinterface RedisLikeExecutionCacheClientRedis Like Execution Cache Client interface with 3 public fields or methods.

RedisExecutionCacheStore

Key-bound shared Execution Cache Store. The client port can wrap local, self-hosted, or managed Redis without exposing a Redis SDK to Core.

  • Kind: class
  • Import: import { RedisExecutionCacheStore } from '@codesoul-co/hypha-adapters-local';
  • Source module: redis-execution-cache-store

Declaration

text
export declare class RedisExecutionCacheStore implements ExecutionCacheStore {
    constructor(options: RedisExecutionCacheStoreOptions);
    get(key: string): Promise<ExecutionCacheRecord | null>;
    set(key: string, input: ExecutionCacheRecord): Promise<void>;
    delete(key: string): Promise<void>;
}

Public members

MemberKindSignatureDescription
constructorconstructor(options: RedisExecutionCacheStoreOptions): RedisExecutionCacheStoreCreates 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, input: ExecutionCacheRecord): Promise<void>Public method; parameters and return type are shown in the signature.

RedisExecutionCacheStoreOptions

Redis Execution Cache Store Options interface with 5 public fields or methods.

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

Declaration

text
export interface RedisExecutionCacheStoreOptions {
    client: RedisLikeExecutionCacheClient;
    namespace?: string;
    maxEntryBytes?: number;
    defaultTtlMs?: number;
    now?: () => number;
}

Contract members

MemberKindSignatureDescription
clientpropertyclient: RedisLikeExecutionCacheClientPublic property; its type, readonly modifier and optionality are shown in the signature.
defaultTtlMspropertydefaultTtlMs?: 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.
namespacepropertynamespace?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
nowmethodnow?(): numberPublic method; parameters and return type are shown in the signature.

RedisLikeExecutionCacheClient

Redis Like Execution Cache Client interface with 3 public fields or methods.

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

Declaration

text
export interface RedisLikeExecutionCacheClient {
    get(key: string): Promise<string | null>;
    set(key: string, value: string, mode: 'PX', durationMilliseconds: number): Promise<unknown>;
    del(...keys: string[]): Promise<number>;
}

Contract members

MemberKindSignatureDescription
delmethoddel(...keys: string[]): Promise<number>Public method; parameters and return type are shown in the signature.
getmethodget(key: string): Promise<string | null>Public method; parameters and return type are shown in the signature.
setmethodset(key: string, value: string, mode: "PX", durationMilliseconds: number): Promise<unknown>Public method; parameters and return type are shown in the signature.