Skip to content

@codesoul-co/hypha-core / modules/runtime/runtime-cancellation-service

Using this module

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

Import from the package entrypoint

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

import type {
  RuntimeCancellationServiceOptions,
} 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
RuntimeCancellationServiceclassnew RuntimeCancellationService(options: RuntimeCancellationServiceOptions): RuntimeCancellationServiceRuntime Cancellation Service class with 2 public constructor or member entries; its exact declarations are listed below.
RuntimeCancellationServiceOptionsinterfaceinterface RuntimeCancellationServiceOptionsRuntime Cancellation Service Options interface with 9 public fields or methods.

RuntimeCancellationService

Runtime Cancellation Service class with 2 public constructor or member entries; its exact declarations are listed below.

Declaration

text
export declare class RuntimeCancellationService {
    constructor(options: RuntimeCancellationServiceOptions);
    cancel(input: RuntimeCancelCommand): Promise<RuntimeCancelResult>;
}

Public members

MemberKindSignatureDescription
cancelmethodcancel(input: RuntimeCancelCommand): Promise<RuntimeCancelResult>Public method; parameters and return type are shown in the signature.
constructorconstructor(options: RuntimeCancellationServiceOptions): RuntimeCancellationServiceCreates an instance of this class.

RuntimeCancellationServiceOptions

Runtime Cancellation Service Options interface with 9 public fields or methods.

Declaration

text
export interface RuntimeCancellationServiceOptions {
    events: EventRuntime;
    projections: ProjectionEngine;
    projectionStore: ProjectionStore<RuntimeOrchestrationProjection>;
    runLeases: RunLeaseStore;
    commands: Pick<SessionQueue, 'cancelPending'>;
    activities: RuntimeActivityCancellationPort;
    children: RuntimeChildRunCancellationPort;
    now?: () => string;
    nextId?: (namespace: string) => string;
}

Contract members

MemberKindSignatureDescription
activitiespropertyactivities: RuntimeActivityCancellationPortPublic property; its type, readonly modifier and optionality are shown in the signature.
childrenpropertychildren: RuntimeChildRunCancellationPortPublic property; its type, readonly modifier and optionality are shown in the signature.
commandspropertycommands: Pick<SessionQueue, "cancelPending">Public property; its type, readonly modifier and optionality are shown in the signature.
eventspropertyevents: EventRuntimePublic property; its type, readonly modifier and optionality 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.
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.
runLeasespropertyrunLeases: RunLeaseStorePublic property; its type, readonly modifier and optionality are shown in the signature.