createStream
createStream<
T,V>(streamFunction,streamValueMutator?,options?):Promise<AsyncStreamProxy<V>>
Defined in: sdks/js/node-sdk/src/utils/streams.ts:95
Creates a stream from a stream function
If the stream fails, an attempt will be made to restart it.
Ending the stream is terminal: no callbacks are invoked and no native stream is created after the stream ends.
This function is not intended to be used directly.
Type Parameters
Section titled “Type Parameters”T = unknown
V = T
Parameters
Section titled “Parameters”streamFunction
Section titled “streamFunction”The stream function to create a stream from
streamValueMutator?
Section titled “streamValueMutator?”StreamValueMutator<T, V | undefined>
An optional function to mutate the value emitted from the stream
options?
Section titled “options?”StreamOptions<T, V>
The options for the stream
Returns
Section titled “Returns”Promise<AsyncStreamProxy<V>>
An async iterable stream proxy
Throws
Section titled “Throws”if the retryAttempts option is less than 0 and retryOnFail is true
Throws
Section titled “Throws”if the stream fails and can’t be restarted

