@codesoul-co/hypha-core / modules/runtime/session-command-scheduler
- Package index:
@codesoul-co/hypha-core - Source:
packages/core/src/modules/runtime/session-command-scheduler.ts - Exports: 5
Using this module
Use the Session command scheduler module for executing runtime behavior at this boundary. It exports 1 class, 4 interfaces.
Import from the package entrypoint
ts
import {
DurableSessionCommandScheduler,
} from '@codesoul-co/hypha-core';
import type {
DurableSessionCommandSchedulerOptions,
RunSessionCommandSchedulerRequest,
SessionCommandProcessor,
SessionCommandSchedulerResult,
} from '@codesoul-co/hypha-core';Usage patterns
- Use the 4 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
| Symbol | Kind | Signature | Description |
|---|---|---|---|
DurableSessionCommandScheduler | class | new DurableSessionCommandScheduler(options: DurableSessionCommandSchedulerOptions): DurableSessionCommandScheduler | Repeatedly invokes a single-command processor until shutdown is requested. Abort stops new claims, wakes idle waits, and lets an in-flight handler drain. |
DurableSessionCommandSchedulerOptions | interface | interface DurableSessionCommandSchedulerOptions | Durable Session Command Scheduler Options interface with 7 public fields or methods. |
RunSessionCommandSchedulerRequest | interface | interface RunSessionCommandSchedulerRequest | Run Session Command Scheduler Request interface with 2 public fields or methods. |
SessionCommandProcessor | interface | interface SessionCommandProcessor | Session Command Processor interface with 1 public fields or methods. |
SessionCommandSchedulerResult | interface | interface SessionCommandSchedulerResult | Session Command Scheduler Result interface with 3 public fields or methods. |
DurableSessionCommandScheduler
Repeatedly invokes a single-command processor until shutdown is requested. Abort stops new claims, wakes idle waits, and lets an in-flight handler drain.
- Kind: class
- Import:
import { DurableSessionCommandScheduler } from '@codesoul-co/hypha-core'; - Source module:
modules/runtime/session-command-scheduler
Declaration
text
export declare class DurableSessionCommandScheduler {
constructor(options: DurableSessionCommandSchedulerOptions);
run(request: RunSessionCommandSchedulerRequest): Promise<SessionCommandSchedulerResult>;
}Public members
| Member | Kind | Signature | Description |
|---|---|---|---|
constructor | constructor | (options: DurableSessionCommandSchedulerOptions): DurableSessionCommandScheduler | Creates an instance of this class. |
run | method | run(request: RunSessionCommandSchedulerRequest): Promise<SessionCommandSchedulerResult> | Public method; parameters and return type are shown in the signature. |
DurableSessionCommandSchedulerOptions
Durable Session Command Scheduler Options interface with 7 public fields or methods.
- Kind: interface
- Import:
import type { DurableSessionCommandSchedulerOptions } from '@codesoul-co/hypha-core'; - Source module:
modules/runtime/session-command-scheduler
Declaration
text
export interface DurableSessionCommandSchedulerOptions {
worker: SessionCommandProcessor;
pollIntervalMs?: number;
errorBackoffMs?: number;
shutdownDrainMs?: number;
wait?: (delayMs: number, signal: AbortSignal) => Promise<void>;
onResult?: (result: SessionCommandWorkerResult) => void;
onError?: (error: unknown) => void;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
errorBackoffMs | property | errorBackoffMs?: number | Public property; its type, readonly modifier and optionality are shown in the signature. |
onError | method | onError?(error: unknown): void | Public method; parameters and return type are shown in the signature. |
onResult | method | onResult?(result: SessionCommandWorkerResult): void | Public method; parameters and return type are shown in the signature. |
pollIntervalMs | property | pollIntervalMs?: number | Public property; its type, readonly modifier and optionality are shown in the signature. |
shutdownDrainMs | property | shutdownDrainMs?: number | Public property; its type, readonly modifier and optionality are shown in the signature. |
wait | method | wait?(delayMs: number, signal: AbortSignal): Promise<void> | Public method; parameters and return type are shown in the signature. |
worker | property | worker: SessionCommandProcessor | Public property; its type, readonly modifier and optionality are shown in the signature. |
RunSessionCommandSchedulerRequest
Run Session Command Scheduler Request interface with 2 public fields or methods.
- Kind: interface
- Import:
import type { RunSessionCommandSchedulerRequest } from '@codesoul-co/hypha-core'; - Source module:
modules/runtime/session-command-scheduler
Declaration
text
export interface RunSessionCommandSchedulerRequest {
signal: AbortSignal;
scope?: SessionQueueScope;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
scope | property | scope?: SessionQueueScope | Public property; its type, readonly modifier and optionality are shown in the signature. |
signal | property | signal: AbortSignal | Public property; its type, readonly modifier and optionality are shown in the signature. |
SessionCommandProcessor
Session Command Processor interface with 1 public fields or methods.
- Kind: interface
- Import:
import type { SessionCommandProcessor } from '@codesoul-co/hypha-core'; - Source module:
modules/runtime/session-command-scheduler
Declaration
text
export interface SessionCommandProcessor {
processNext(scope?: SessionQueueScope, signal?: AbortSignal): Promise<SessionCommandWorkerResult>;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
processNext | method | processNext(scope?: SessionQueueScope, signal?: AbortSignal): Promise<SessionCommandWorkerResult> | Public method; parameters and return type are shown in the signature. |
SessionCommandSchedulerResult
Session Command Scheduler Result interface with 3 public fields or methods.
- Kind: interface
- Import:
import type { SessionCommandSchedulerResult } from '@codesoul-co/hypha-core'; - Source module:
modules/runtime/session-command-scheduler
Declaration
text
export interface SessionCommandSchedulerResult {
processed: number;
idlePolls: number;
errors: number;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
errors | property | errors: number | Public property; its type, readonly modifier and optionality are shown in the signature. |
idlePolls | property | idlePolls: number | Public property; its type, readonly modifier and optionality are shown in the signature. |
processed | property | processed: number | Public property; its type, readonly modifier and optionality are shown in the signature. |
