Function: toReadableStream()
function toReadableStream(stream: AsyncGenerator<SessionState, any, unknown>, keepAliveDelay: number): ReadableStream<any>
Generate a Server-Sent-Event ReadableStream from a generator returned by client.runStream
.
Parameters
Parameter | Type | Description |
---|---|---|
|
| An async generator returned by |
|
| The delay in milliseconds to send keep-alive messages. Default is 1 minute. |
Returns
ReadableStream
<any
>
A ReadableStream object