Skip to content

@codesoul-co/hypha-core / contracts/runtime-timer

Using this module

Use the Runtime timer module for declaring and runtime-validating contracts. It exports 1 constant, 4 interfaces, 1 type.

Import from the package entrypoint

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

import type {
  RuntimeTimerStreamScope,
  RuntimeTimerSweepRequest,
  RuntimeTimerSweepResult,
  RuntimeTimerSweepRunResult,
  RuntimeTimerSweepDisposition,
} from '@codesoul-co/hypha-core';

Usage patterns

  • Use the 5 type/interface exports as static contracts in application code, adapters, or tests. Import them with import type; they do not exist at runtime.
  • The 1 constant/enum export provides stable values, schemas, definitions, or defaults. Reuse these exports instead of copying internal values into an application.

Public exports

SymbolKindSignatureDescription
RUNTIME_TIMER_SWEEP_DISPOSITIONSconstantconst RUNTIME_TIMER_SWEEP_DISPOSITIONS: readonly ["fired", "not_due", "lease_unavailable", "already_resolved"]RUNTIME TIMER SWEEP DISPOSITIONS constant exported by the contracts/runtime-timer module.
RuntimeTimerStreamScopeinterfaceinterface RuntimeTimerStreamScopeRuntime Timer Stream Scope interface with 3 public fields or methods.
RuntimeTimerSweepRequestinterfaceinterface RuntimeTimerSweepRequestRuntime Timer Sweep Request interface with 5 public fields or methods.
RuntimeTimerSweepResultinterfaceinterface RuntimeTimerSweepResultRuntime Timer Sweep Result interface with 7 public fields or methods.
RuntimeTimerSweepRunResultinterfaceinterface RuntimeTimerSweepRunResultRuntime Timer Sweep Run Result interface with 3 public fields or methods.
RuntimeTimerSweepDispositiontypetype RuntimeTimerSweepDisposition = (typeof RUNTIME_TIMER_SWEEP_DISPOSITIONS)[number]Public type alias for Runtime Timer Sweep Disposition; the declaration contains its complete type expression.

RUNTIME_TIMER_SWEEP_DISPOSITIONS

RUNTIME TIMER SWEEP DISPOSITIONS constant exported by the contracts/runtime-timer module.

  • Kind: constant
  • Import: import { RUNTIME_TIMER_SWEEP_DISPOSITIONS } from '@codesoul-co/hypha-core';
  • Source module: contracts/runtime-timer

Declaration

text
export declare const RUNTIME_TIMER_SWEEP_DISPOSITIONS: readonly ["fired", "not_due", "lease_unavailable", "already_resolved"];

RuntimeTimerStreamScope

Runtime Timer Stream Scope interface with 3 public fields or methods.

  • Kind: interface
  • Import: import type { RuntimeTimerStreamScope } from '@codesoul-co/hypha-core';
  • Source module: contracts/runtime-timer

Declaration

text
export interface RuntimeTimerStreamScope {
    tenantId?: string;
    userId: string;
    runId: string;
}

Contract members

MemberKindSignatureDescription
runIdpropertyrunId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
tenantIdpropertytenantId?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
userIdpropertyuserId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.

RuntimeTimerSweepRequest

Runtime Timer Sweep Request interface with 5 public fields or methods.

  • Kind: interface
  • Import: import type { RuntimeTimerSweepRequest } from '@codesoul-co/hypha-core';
  • Source module: contracts/runtime-timer

Declaration

text
export interface RuntimeTimerSweepRequest {
    ownerId: string;
    leaseTtlMs: number;
    limit: number;
    cursor?: string;
    firedAt: string;
}

Contract members

MemberKindSignatureDescription
cursorpropertycursor?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
firedAtpropertyfiredAt: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
leaseTtlMspropertyleaseTtlMs: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
limitpropertylimit: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
ownerIdpropertyownerId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.

RuntimeTimerSweepResult

Runtime Timer Sweep Result interface with 7 public fields or methods.

  • Kind: interface
  • Import: import type { RuntimeTimerSweepResult } from '@codesoul-co/hypha-core';
  • Source module: contracts/runtime-timer

Declaration

text
export interface RuntimeTimerSweepResult {
    scanned: number;
    fired: number;
    notDue: number;
    leaseUnavailable: number;
    alreadyResolved: number;
    results: RuntimeTimerSweepRunResult[];
    nextCursor?: string;
}

Contract members

MemberKindSignatureDescription
alreadyResolvedpropertyalreadyResolved: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
firedpropertyfired: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
leaseUnavailablepropertyleaseUnavailable: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
nextCursorpropertynextCursor?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
notDuepropertynotDue: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
resultspropertyresults: RuntimeTimerSweepRunResult[]Public property; its type, readonly modifier and optionality are shown in the signature.
scannedpropertyscanned: numberPublic property; its type, readonly modifier and optionality are shown in the signature.

RuntimeTimerSweepRunResult

Runtime Timer Sweep Run Result interface with 3 public fields or methods.

  • Kind: interface
  • Import: import type { RuntimeTimerSweepRunResult } from '@codesoul-co/hypha-core';
  • Source module: contracts/runtime-timer

Declaration

text
export interface RuntimeTimerSweepRunResult {
    scope: RuntimeTimerStreamScope;
    disposition: RuntimeTimerSweepDisposition;
    eventIds: string[];
}

Contract members

MemberKindSignatureDescription
dispositionpropertydisposition: "lease_unavailable" | "fired" | "not_due" | "already_resolved"Public property; its type, readonly modifier and optionality are shown in the signature.
eventIdspropertyeventIds: string[]Public property; its type, readonly modifier and optionality are shown in the signature.
scopepropertyscope: RuntimeTimerStreamScopePublic property; its type, readonly modifier and optionality are shown in the signature.

RuntimeTimerSweepDisposition

Public type alias for Runtime Timer Sweep Disposition; the declaration contains its complete type expression.

  • Kind: type
  • Import: import type { RuntimeTimerSweepDisposition } from '@codesoul-co/hypha-core';
  • Source module: contracts/runtime-timer

Declaration

text
export type RuntimeTimerSweepDisposition = (typeof RUNTIME_TIMER_SWEEP_DISPOSITIONS)[number];