Skip to content

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

IEventBus.close


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

ExecutionEventImpl

Returns

Promise<void>

Implementation of

IEventBus.publishEvent


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

IEventBus.subscribeToEvents


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>

Implementation of

IEventBus.unsubscribe

Licensed under BUSL-1.1