Skip to content

remora-monorepo


remora-monorepo / lib / BaseExecutionStateChannel

Abstract Class: BaseExecutionStateChannel

Defined in: packages/core/src/executor/channel.ts:40

Abstract base that handles debounce logic so subclasses only implement emit, doClose, and subscribe.

Extended by

Implements

Constructors

Constructor

new BaseExecutionStateChannel(options?): BaseExecutionStateChannel

Defined in: packages/core/src/executor/channel.ts:48

Parameters

options?

WorkflowExecutionStateChannelOptions

Returns

BaseExecutionStateChannel

Methods

close()

close(): void

Defined in: packages/core/src/executor/channel.ts:81

Close the channel, flushing any buffered state first.

Returns

void

Implementation of

WorkflowExecutionStateChannel.close


doClose()

abstract protected doClose(): void

Defined in: packages/core/src/executor/channel.ts:101

Perform subclass-specific close logic (e.g. resolve pending waiters).

Returns

void


emit()

abstract protected emit(state): void

Defined in: packages/core/src/executor/channel.ts:99

Deliver a state snapshot to subscribers. Subclasses implement storage + notification.

Parameters

state
completedAt?

string = "string"

durationMs?

number = "number"

error?

{ category: string; code: string; isRetryable?: boolean; message: string; statusCode?: number; stepId?: string; } = errorSnapshotSchema

error.category

string = "string"

error.code

string = "string"

error.isRetryable?

boolean = "boolean"

error.message

string = "string"

error.statusCode?

number = "number"

error.stepId?

string = "string"

output?

unknown = "unknown"

runId

string = "string"

startedAt

string = "string"

status

"pending" | "running" | "completed" | "failed" = runStatusSchema

stepRecords

object[] = ...

workflowHash?

string = "string"

Returns

void


latest()

latest(): Promise<{ completedAt?: string; durationMs?: number; error?: { category: string; code: string; isRetryable?: boolean; message: string; statusCode?: number; stepId?: string; }; output?: unknown; runId: string; startedAt: string; status: "pending" | "running" | "completed" | "failed"; stepRecords: object[]; workflowHash?: string; } | null>

Defined in: packages/core/src/executor/channel.ts:108

Returns the most recent state. Override in subclasses that track history.

Returns

Promise<{ completedAt?: string; durationMs?: number; error?: { category: string; code: string; isRetryable?: boolean; message: string; statusCode?: number; stepId?: string; }; output?: unknown; runId: string; startedAt: string; status: "pending" | "running" | "completed" | "failed"; stepRecords: object[]; workflowHash?: string; } | null>

Implementation of

WorkflowExecutionStateChannel.latest


publish()

publish(state): void

Defined in: packages/core/src/executor/channel.ts:54

Push a state snapshot, applying debounce if configured.

Parameters

state
completedAt?

string = "string"

durationMs?

number = "number"

error?

{ category: string; code: string; isRetryable?: boolean; message: string; statusCode?: number; stepId?: string; } = errorSnapshotSchema

error.category

string = "string"

error.code

string = "string"

error.isRetryable?

boolean = "boolean"

error.message

string = "string"

error.statusCode?

number = "number"

error.stepId?

string = "string"

output?

unknown = "unknown"

runId

string = "string"

startedAt

string = "string"

status

"pending" | "running" | "completed" | "failed" = runStatusSchema

stepRecords

object[] = ...

workflowHash?

string = "string"

Returns

void

Implementation of

WorkflowExecutionStateChannel.publish


subscribe()

abstract subscribe(opts?): AsyncIterable<{ completedAt?: string; durationMs?: number; error?: { category: string; code: string; isRetryable?: boolean; message: string; statusCode?: number; stepId?: string; }; output?: unknown; runId: string; startedAt: string; status: "pending" | "running" | "completed" | "failed"; stepRecords: object[]; workflowHash?: string; }>

Defined in: packages/core/src/executor/channel.ts:103

Subscribe to state updates.

  • Default (replay: false): yields the latest state immediately (if any), then follows live.
  • replay: true: yields the full history from the beginning, then follows live.

Parameters

opts?
replay?

boolean

Returns

AsyncIterable<{ completedAt?: string; durationMs?: number; error?: { category: string; code: string; isRetryable?: boolean; message: string; statusCode?: number; stepId?: string; }; output?: unknown; runId: string; startedAt: string; status: "pending" | "running" | "completed" | "failed"; stepRecords: object[]; workflowHash?: string; }>

Implementation of

WorkflowExecutionStateChannel.subscribe