Skip to content

PersistentAI API Documentation / @persistentai/fireflow-executor / server / InMemoryEventBus

Class: InMemoryEventBus

Defined in: packages/fireflow-executor/server/implementations/local/InMemoryEventBus.ts:20

In-memory implementation of IEventBus for local development Uses EventQueue for each execution to handle event streaming

Implements

Constructors

Constructor

new InMemoryEventBus(): InMemoryEventBus

Returns

InMemoryEventBus

Methods

close()

close(): Promise<void>

Defined in: packages/fireflow-executor/server/implementations/local/InMemoryEventBus.ts:115

Close all subscriptions and cleanup resources

Returns

Promise<void>

Implementation of

IEventBus.close


publishEvent()

publishEvent(executionId, event): Promise<void>

Defined in: packages/fireflow-executor/server/implementations/local/InMemoryEventBus.ts:24

Publish an execution event

Parameters

executionId

string

event

ExecutionEventImpl

Returns

Promise<void>

Implementation of

IEventBus.publishEvent


subscribeToEvents()

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

Defined in: packages/fireflow-executor/server/implementations/local/InMemoryEventBus.ts:44

Subscribe to execution events Returns an async iterator for streaming events

Parameters

executionId

string

fromIndex?

number = 0

Returns

AsyncIterable<ExecutionEventImpl<ExecutionEventEnum>[]>

Implementation of

IEventBus.subscribeToEvents


subscribeToExecutionTree()

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

Defined in: packages/fireflow-executor/server/implementations/local/InMemoryEventBus.ts:98

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

Parameters

rootWorkflowId

string

fromIndex?

number = 0

batchConfig?

EventBatchConfig

Returns

AsyncIterable<ExecutionEventImpl<ExecutionEventEnum>[]>

Implementation of

IEventBus.subscribeToExecutionTree


unsubscribe()

unsubscribe(executionId): Promise<void>

Defined in: packages/fireflow-executor/server/implementations/local/InMemoryEventBus.ts:106

Unsubscribe from events for a specific execution

Parameters

executionId

string

Returns

Promise<void>

Implementation of

IEventBus.unsubscribe

Licensed under BUSL-1.1