Skip to content

@codesoul-co/hypha-memory / structured-lifecycle-task-store

Using this module

Use the Structured lifecycle task store module for persisting and reading data at this boundary. It exports 1 class, 1 interface.

Import from the package entrypoint

ts
import {
  StructuredMemoryLifecycleTaskStore,
} from '@codesoul-co/hypha-memory';

import type {
  StructuredMemoryLifecycleTaskStoreOptions,
} from '@codesoul-co/hypha-memory';

Usage patterns

  • Use the 1 type/interface export 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
StructuredMemoryLifecycleTaskStoreclassnew StructuredMemoryLifecycleTaskStore(options: StructuredMemoryLifecycleTaskStoreOptions): StructuredMemoryLifecycleTaskStoreStructured Memory Lifecycle Task Store class with 7 public constructor or member entries; its exact declarations are listed below.
StructuredMemoryLifecycleTaskStoreOptionsinterfaceinterface StructuredMemoryLifecycleTaskStoreOptionsStructured Memory Lifecycle Task Store Options interface with 2 public fields or methods.

StructuredMemoryLifecycleTaskStore

Structured Memory Lifecycle Task Store class with 7 public constructor or member entries; its exact declarations are listed below.

Declaration

text
export declare class StructuredMemoryLifecycleTaskStore implements MemoryLifecycleTaskStore {
    constructor(options: StructuredMemoryLifecycleTaskStoreOptions);
    enqueue(task: MemoryLifecycleTask): Promise<void>;
    lease(type: MemoryLifecycleWorkerType, ownerId: string, now: string, leaseUntil: string, limit: number): Promise<MemoryLifecycleTask[]>;
    renew(taskId: string, ownerId: string, leaseToken: string, now: string, leaseUntil: string): Promise<boolean>;
    complete(taskId: string, ownerId: string, leaseToken: string, now: string): Promise<boolean>;
    fail(taskId: string, ownerId: string, leaseToken: string, now: string, error: NormalizedMemoryError, retryAt: string, deadLetter: boolean): Promise<boolean>;
    list(type?: MemoryLifecycleWorkerType): Promise<MemoryLifecycleTask[]>;
}

Public members

MemberKindSignatureDescription
completemethodcomplete(taskId: string, ownerId: string, leaseToken: string, now: string): Promise<boolean>Public method; parameters and return type are shown in the signature.
constructorconstructor(options: StructuredMemoryLifecycleTaskStoreOptions): StructuredMemoryLifecycleTaskStoreCreates an instance of this class.
enqueuemethodenqueue(task: MemoryLifecycleTask): Promise<void>Public method; parameters and return type are shown in the signature.
failmethodfail(taskId: string, ownerId: string, leaseToken: string, now: string, error: NormalizedMemoryError, retryAt: string, deadLetter: boolean): Promise<boolean>Public method; parameters and return type are shown in the signature.
leasemethodlease(type: MemoryLifecycleWorkerType, ownerId: string, now: string, leaseUntil: string, limit: number): Promise<MemoryLifecycleTask[]>Public method; parameters and return type are shown in the signature.
listmethodlist(type?: MemoryLifecycleWorkerType): Promise<MemoryLifecycleTask[]>Public method; parameters and return type are shown in the signature.
renewmethodrenew(taskId: string, ownerId: string, leaseToken: string, now: string, leaseUntil: string): Promise<boolean>Public method; parameters and return type are shown in the signature.

StructuredMemoryLifecycleTaskStoreOptions

Structured Memory Lifecycle Task Store Options interface with 2 public fields or methods.

  • Kind: interface
  • Import: import type { StructuredMemoryLifecycleTaskStoreOptions } from '@codesoul-co/hypha-memory';
  • Source module: structured-lifecycle-task-store

Declaration

text
export interface StructuredMemoryLifecycleTaskStoreOptions {
    store: StructuredStoreProvider;
    table?: string;
}

Contract members

MemberKindSignatureDescription
storepropertystore: StructuredStoreProviderPublic property; its type, readonly modifier and optionality are shown in the signature.
tablepropertytable?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.