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
| Parameter | Type |
|---|---|
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
| Parameter | Type |
|---|---|
current | number |
total? | number |
message? | string |
Returns
void
snapshot()
ts
snapshot(): StreamingAggregator;Defined in: packages/tools/src/streaming/channel.ts:83
Snapshot the aggregated buffer.
Returns
streamContent()
ts
streamContent(chunk): void;Defined in: packages/tools/src/streaming/channel.ts:79
Emit a content chunk into the channel.
Parameters
| Parameter | Type |
|---|---|
chunk | ContentChunk |
Returns
void