Skip to content

@codesoul-co/hypha-core / modules/runtime/runtime-timer-worker

Using this module

Use the Runtime timer worker module for executing runtime behavior at this boundary. It exports 1 class, 1 interface.

Import from the package entrypoint

ts
import {
  DurableRuntimeTimerWorker,
} from '@codesoul-co/hypha-core';

import type {
  DurableRuntimeTimerWorkerOptions,
} from '@codesoul-co/hypha-core';

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
DurableRuntimeTimerWorkerclassnew DurableRuntimeTimerWorker(options: DurableRuntimeTimerWorkerOptions): DurableRuntimeTimerWorkerDurable Runtime Timer Worker class with 2 public constructor or member entries; its exact declarations are listed below.
DurableRuntimeTimerWorkerOptionsinterfaceinterface DurableRuntimeTimerWorkerOptionsDurable Runtime Timer Worker Options interface with 11 public fields or methods.

DurableRuntimeTimerWorker

Durable Runtime Timer Worker class with 2 public constructor or member entries; its exact declarations are listed below.

Declaration

text
export declare class DurableRuntimeTimerWorker {
    constructor(options: DurableRuntimeTimerWorkerOptions);
    sweep(input: RuntimeTimerSweepRequest): Promise<RuntimeTimerSweepResult>;
}

Public members

MemberKindSignatureDescription
constructorconstructor(options: DurableRuntimeTimerWorkerOptions): DurableRuntimeTimerWorkerCreates an instance of this class.
sweepmethodsweep(input: RuntimeTimerSweepRequest): Promise<RuntimeTimerSweepResult>Public method; parameters and return type are shown in the signature.

DurableRuntimeTimerWorkerOptions

Durable Runtime Timer Worker Options interface with 11 public fields or methods.

Declaration

text
export interface DurableRuntimeTimerWorkerOptions {
    events: EventRuntime;
    projections: ProjectionEngine;
    projectionStore: ProjectionStore<RuntimeOrchestrationProjection>;
    runLeases: RunLeaseStore;
    renewalIntervalMs?: number;
    wait?: (delayMs: number, signal: AbortSignal) => Promise<void>;
    onLeaseRenewalFailure?: (error: unknown, runId: string) => void;
    operationalTelemetry?: RuntimeOperationalTelemetry;
    monotonicNow?: () => number;
    now?: () => string;
    nextId?: (namespace: string) => string;
}

Contract members

MemberKindSignatureDescription
eventspropertyevents: EventRuntimePublic property; its type, readonly modifier and optionality are shown in the signature.
monotonicNowmethodmonotonicNow?(): numberPublic method; parameters and return type are shown in the signature.
nextIdmethodnextId?(namespace: string): stringPublic method; parameters and return type are shown in the signature.
nowmethodnow?(): stringPublic method; parameters and return type are shown in the signature.
onLeaseRenewalFailuremethodonLeaseRenewalFailure?(error: unknown, runId: string): voidPublic method; parameters and return type are shown in the signature.
operationalTelemetrypropertyoperationalTelemetry?: RuntimeOperationalTelemetryPublic property; its type, readonly modifier and optionality are shown in the signature.
projectionspropertyprojections: ProjectionEnginePublic property; its type, readonly modifier and optionality are shown in the signature.
projectionStorepropertyprojectionStore: ProjectionStore<RuntimeOrchestrationProjection>Public property; its type, readonly modifier and optionality are shown in the signature.
renewalIntervalMspropertyrenewalIntervalMs?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
runLeasespropertyrunLeases: RunLeaseStorePublic property; its type, readonly modifier and optionality are shown in the signature.
waitmethodwait?(delayMs: number, signal: AbortSignal): Promise<void>Public method; parameters and return type are shown in the signature.