Skip to content

@persistent-ai/fireflow-executor / server / IEventBus

Interface: IEventBus ​

Defined in: packages/fireflow-executor/server/interfaces/IEventBus.ts:26

Interface for event bus implementations Handles publishing and subscribing to execution events

Properties ​

close ​

close: () => Promise<void>

Defined in: packages/fireflow-executor/server/interfaces/IEventBus.ts:77

Close all subscriptions and cleanup resources

Returns ​

Promise<void>


publishEvent ​

publishEvent: (executionId, event) => Promise<void>

Defined in: packages/fireflow-executor/server/interfaces/IEventBus.ts:30

Publish an execution event

Parameters ​

executionId ​

string

event ​

ExecutionEventImpl

Returns ​

Promise<void>


subscribeToEvents ​

subscribeToEvents: (executionId, fromIndex?, batchConfig?) => AsyncIterable<ExecutionEventImpl<ExecutionEventEnum>[]>

Defined in: packages/fireflow-executor/server/interfaces/IEventBus.ts:40

Subscribe to execution events Returns an async iterator for streaming events

Parameters ​

executionId ​

string

Execution ID to subscribe to

fromIndex? ​

number

Starting event index (0-based)

batchConfig? ​

EventBatchConfig

Optional batching configuration for consumers

Returns ​

AsyncIterable<ExecutionEventImpl<ExecutionEventEnum>[]>


subscribeToExecutionTree ​

subscribeToExecutionTree: (rootWorkflowId, fromIndex?, batchConfig?) => AsyncIterable<ExecutionEventImpl<ExecutionEventEnum>[]>

Defined in: packages/fireflow-executor/server/interfaces/IEventBus.ts:50

Subscribe to execution tree events (root + all branch subworkflows). Falls back to regular subscribeToEvents if no branches exist.

Parameters ​

rootWorkflowId ​

string

fromIndex? ​

number

batchConfig? ​

EventBatchConfig

Returns ​

AsyncIterable<ExecutionEventImpl<ExecutionEventEnum>[]>


subscribeToStream? ​

optional subscribeToStream?: <T>(workflowId, streamKey, fromOffset?, batchConfig?, options?) => AsyncIterable<T[]>

Defined in: packages/fireflow-executor/server/interfaces/IEventBus.ts:61

Subscribe to an arbitrary DBOS stream by workflow ID and stream key. Used for port-level frontend streaming (STREAM_PUBLISHED events). Optional — only available in DBOS mode.

Type Parameters ​

T ​

T = any

Parameters ​

workflowId ​

string

streamKey ​

string

fromOffset? ​

number

batchConfig? ​

EventBatchConfig

options? ​
oneShot? ​

boolean

Returns ​

AsyncIterable<T[]>


unsubscribe ​

unsubscribe: (executionId) => Promise<void>

Defined in: packages/fireflow-executor/server/interfaces/IEventBus.ts:72

Unsubscribe from events for a specific execution

Parameters ​

executionId ​

string

Returns ​

Promise<void>

Licensed under BUSL-1.1