StitchableStream<T>
Namespace: Vercel.AI.Util
public sealed class StitchableStream<T>A stream that reads inner streams one at a time.
Type parameters
| Name | Description |
|---|---|
T |
Inheritance: object
Constructors
Section titled “Constructors”StitchableStream()
Section titled “StitchableStream()”public StitchableStream()Creates an empty stitchable stream.
Properties
Section titled “Properties”Stream
Section titled “Stream”public ReadableStream<T> Stream { get; }Outer stream.
Value: ReadableStream<T>
Methods
Section titled “Methods”AddStream(ReadableStream<T>?, Action<object>?, Action?)
Section titled “AddStream(ReadableStream<T>?, Action<object>?, Action?)”public void AddStream(ReadableStream<T>? inner, Action<object>? onError = null, Action? onCancel = null)Queues <code class=“paramref”>inner</code> to be read after the streams already added.
Parameters
| Name | Type | Description |
|---|---|---|
inner |
ReadableStream<T> |
|
onError |
Action<object> | |
onCancel |
Action |
Close()
Section titled “Close()”public void Close()Lets current inner streams finish, then closes the outer stream.
Terminate()
Section titled “Terminate()”public void Terminate()Cancels every inner stream and closes the outer stream.
Apache-2.0 · Copyright 2023 Vercel, Inc. · unofficial community port, not an official Vercel product