Skip to content

PersistentAI API Documentation / @persistentai/fireflow-types / startOutboundBridge

Function: startOutboundBridge()

startOutboundBridge<T>(channel, dbos, edgeId): Promise<void>

Defined in: packages/fireflow-types/src/flow/execution/runtime/stream-bridge.ts:108

Start an outbound stream bridge as a DBOS step. Returns a promise that resolves when the channel closes and all data is pumped. After awaiting the returned promise, the caller MUST call dbos.closeStream(streamKey) at workflow level to signal the reader that the stream is complete.

Type Parameters

T

T

Parameters

channel

MultiChannel<T>

The source MultiChannel

dbos

IDBOSContextService

DBOS context service

edgeId

string

The edge ID (used to derive stream key)

Returns

Promise<void>

Promise that resolves when pumping is complete

Example

typescript
const streamKey = streamKeyForEdge(edge.id)
const pumpDone = startOutboundBridge(sourceChannel, dbos, edge.id)
// ... later, after pumping completes:
await pumpDone
await dbos.closeStream(streamKey) // workflow level!

Licensed under BUSL-1.1