remora-monorepo / lib / MemoryExecutionStateChannel
Class: MemoryExecutionStateChannel
Defined in: packages/core/src/executor/channel.ts:119
A simple in-memory channel that buffers all published states in an array. Suitable for single-process use (e.g. executeWorkflowStream).
Extends
Constructors
Constructor
new MemoryExecutionStateChannel(
options?):MemoryExecutionStateChannel
Defined in: packages/core/src/executor/channel.ts:48
Parameters
options?
WorkflowExecutionStateChannelOptions
Returns
MemoryExecutionStateChannel
Inherited from
BaseExecutionStateChannel.constructor
Methods
close()
close():
void
Defined in: packages/core/src/executor/channel.ts:81
Close the channel, flushing any buffered state first.
Returns
void
Inherited from
BaseExecutionStateChannel.close
doClose()
protecteddoClose():void
Defined in: packages/core/src/executor/channel.ts:133
Perform subclass-specific close logic (e.g. resolve pending waiters).
Returns
void
Overrides
BaseExecutionStateChannel.doClose
emit()
protectedemit(state):void
Defined in: packages/core/src/executor/channel.ts:124
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
Overrides
BaseExecutionStateChannel.emit
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:141
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>
Overrides
BaseExecutionStateChannel.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
Inherited from
BaseExecutionStateChannel.publish
subscribe()
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:149
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; }>