-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Open
Labels
needs-area-labelUsed by the dotnet-issue-labeler to label those issues which couldn't be triaged automaticallyUsed by the dotnet-issue-labeler to label those issues which couldn't be triaged automatically
Description
Is there an existing issue for this?
- I have searched the existing issues
Describe the bug
When running my application in our production environment, our SSE endpoints did not work. The main difference between my dev environment (which works) and prod (which does not) is that in prod we are hosting in IIS.
It can be made to work by doing:
static async IAsyncEnumerable<T> FlushingIterator<T>(IAsyncEnumerable<T> inner, HttpResponse response)
{
await foreach (var item in inner)
{
yield return item;
await response.Body.FlushAsync();
}
}
await SseFormatter.WriteAsync(FlushingIterator(GetMyEvents(), Response), Response.Body, cancellationToken);
but I find it unexpected that it does not do this out of the box.
Expected Behavior
The output stream should be flushed immediately after an event is written by the SseFormatter.
Steps To Reproduce
await SseFormatter.WriteAsync(GetMyEvents(), Response.Body, cancellationToken);
Exceptions (if any)
No response
.NET Version
No response
Anything else?
No response
Metadata
Metadata
Assignees
Labels
needs-area-labelUsed by the dotnet-issue-labeler to label those issues which couldn't be triaged automaticallyUsed by the dotnet-issue-labeler to label those issues which couldn't be triaged automatically