Skip to content

ChainGraph API Documentation / @badaitech/chaingraph-executor / server / IEventBus

Interface: IEventBus

Defined in: packages/chaingraph-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/chaingraph-executor/server/interfaces/IEventBus.ts:54

Close all subscriptions and cleanup resources

Returns

Promise<void>


publishEvent()

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

Defined in: packages/chaingraph-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/chaingraph-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>[]>


unsubscribe()

unsubscribe: (executionId) => Promise<void>

Defined in: packages/chaingraph-executor/server/interfaces/IEventBus.ts:49

Unsubscribe from events for a specific execution

Parameters

executionId

string

Returns

Promise<void>

Licensed under BUSL-1.1