Skip to content

@codesoul-co/hypha-memory / memory-worker-supervisor

Using this module

Use the Memory worker supervisor module for using the public contracts and operations for this capability boundary. It exports 1 class, 2 interfaces.

Import from the package entrypoint

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

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

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
MemoryWorkerSupervisorclassnew MemoryWorkerSupervisor(options: MemoryWorkerSupervisorOptions): MemoryWorkerSupervisorOwns startup recovery and graceful shutdown for restart-safe Memory workers.
MemoryWorkerSupervisorOptionsinterfaceinterface MemoryWorkerSupervisorOptionsMemory Worker Supervisor Options interface with 1 public fields or methods.
SupervisedMemoryWorkerinterfaceinterface SupervisedMemoryWorkerSupervised Memory Worker interface with 3 public fields or methods.

MemoryWorkerSupervisor

Owns startup recovery and graceful shutdown for restart-safe Memory workers.

  • Kind: class
  • Import: import { MemoryWorkerSupervisor } from '@codesoul-co/hypha-memory';
  • Source module: memory-worker-supervisor

Declaration

text
export declare class MemoryWorkerSupervisor {
    constructor(options: MemoryWorkerSupervisorOptions);
    start(): Promise<void>;
    stop(): Promise<void>;
    status(): 'idle' | 'starting' | 'running' | 'stopping' | 'stopped';
}

Public members

MemberKindSignatureDescription
constructorconstructor(options: MemoryWorkerSupervisorOptions): MemoryWorkerSupervisorCreates an instance of this class.
startmethodstart(): Promise<void>Public method; parameters and return type are shown in the signature.
statusmethodstatus(): "idle" | "starting" | "running" | "stopping" | "stopped"Public method; parameters and return type are shown in the signature.
stopmethodstop(): Promise<void>Public method; parameters and return type are shown in the signature.

MemoryWorkerSupervisorOptions

Memory Worker Supervisor Options interface with 1 public fields or methods.

  • Kind: interface
  • Import: import type { MemoryWorkerSupervisorOptions } from '@codesoul-co/hypha-memory';
  • Source module: memory-worker-supervisor

Declaration

text
export interface MemoryWorkerSupervisorOptions {
    workers: readonly SupervisedMemoryWorker[];
}

Contract members

MemberKindSignatureDescription
workerspropertyworkers: readonly SupervisedMemoryWorker[]Public property; its type, readonly modifier and optionality are shown in the signature.

SupervisedMemoryWorker

Supervised Memory Worker interface with 3 public fields or methods.

  • Kind: interface
  • Import: import type { SupervisedMemoryWorker } from '@codesoul-co/hypha-memory';
  • Source module: memory-worker-supervisor

Declaration

text
export interface SupervisedMemoryWorker {
    start(): void;
    stopAndDrain(): Promise<void>;
    runOnce(): Promise<unknown>;
}

Contract members

MemberKindSignatureDescription
runOncemethodrunOnce(): Promise<unknown>Public method; parameters and return type are shown in the signature.
startmethodstart(): voidPublic method; parameters and return type are shown in the signature.
stopAndDrainmethodstopAndDrain(): Promise<void>Public method; parameters and return type are shown in the signature.