Skip to content

Graphorin API reference v0.1.0


Graphorin API reference / @graphorin/tools / / StreamingChannel

Interface: StreamingChannel

Defined in: packages/tools/src/streaming/channel.ts:75

Public channel surface. Implementations are returned by createStreamingChannel.

Stable

Methods

abort()

ts
abort(reason): void;

Defined in: packages/tools/src/streaming/channel.ts:81

Mark the channel cancelled (post-cancellation calls are no-ops).

Parameters

ParameterType
reason"cancelled" | "finished"

Returns

void


reportProgress()

ts
reportProgress(
   current, 
   total?, 
   message?): void;

Defined in: packages/tools/src/streaming/channel.ts:77

Emit a progress event into the channel.

Parameters

ParameterType
currentnumber
total?number
message?string

Returns

void


snapshot()

ts
snapshot(): StreamingAggregator;

Defined in: packages/tools/src/streaming/channel.ts:83

Snapshot the aggregated buffer.

Returns

StreamingAggregator


streamContent()

ts
streamContent(chunk): void;

Defined in: packages/tools/src/streaming/channel.ts:79

Emit a content chunk into the channel.

Parameters

ParameterType
chunkContentChunk

Returns

void