ChainGraph API Documentation / @badaitech/chaingraph-executor / server / InMemoryEventBus
Class: InMemoryEventBus
Defined in: packages/chaingraph-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/chaingraph-executor/server/implementations/local/InMemoryEventBus.ts:106
Close all subscriptions and cleanup resources
Returns
Promise<void>
Implementation of
publishEvent()
publishEvent(
executionId,event):Promise<void>
Defined in: packages/chaingraph-executor/server/implementations/local/InMemoryEventBus.ts:24
Publish an execution event
Parameters
executionId
string
event
Returns
Promise<void>
Implementation of
subscribeToEvents()
subscribeToEvents(
executionId,fromIndex):AsyncIterable<ExecutionEventImpl<ExecutionEventEnum>[]>
Defined in: packages/chaingraph-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
unsubscribe()
unsubscribe(
executionId):Promise<void>
Defined in: packages/chaingraph-executor/server/implementations/local/InMemoryEventBus.ts:97
Unsubscribe from events for a specific execution
Parameters
executionId
string
Returns
Promise<void>