-
-
Notifications
You must be signed in to change notification settings - Fork 547
Open
Description
Hi,
Hopefully this is the correct place to ask. I'm trying to figure out of I can use this library to stream data but I cannot get it to work yet.
My dotnet backend example that gets converted to Swagger:
[HttpGet("Stream")]
public async IAsyncEnumerable<Thing> GetPropertiesStreaming(CancellationToken cancellationToken)
{
for (int i = 0; i < 10; i++)
{
var stuff = GetStuff(cancellationToken);
yield return new Thing(i, stuff);
}
}My JS code in which I want to iterate over a readable stream:
const res = await ThingsService.getStream()
for (const thing of res) {
yield thing
}In this case res is of type Thing[] but I want it to be something like ReadableStream<Uint8Array>. Is there any way to achieve this because in this case it waits for all data to be returned at once.
Cheers,
sourcx
lukecivantos, sibbl and ahaubenstock
Metadata
Metadata
Assignees
Labels
No labels