IAsyncEnumerable buffer the results and not yield it as stream. #45916
Labels
Needs: Author Feedback
The author of this issue needs to respond in order for us to continue investigating this issue.
old-area-web-frameworks-do-not-use
*DEPRECATED* This label is deprecated in favor of the area-mvc and area-minimal labels
Is there an existing issue for this?
Describe the bug
In this demo value controller the browser buffer and return all the result at 5sec and not every 500ms.
[Route("api/[controller]")] [ApiController] public class ValuesController : ControllerBase { [HttpGet] public IAsyncEnumerable<int> Get() { return FetchItems(); } static async IAsyncEnumerable<int> FetchItems() { for (int i = 1; i <= 10; i++) { await Task.Delay(500); yield return i; } } }
Expected Behavior
Expected to get one integer every 500ms and not all at the end of 5sec as doing on .net 6
Steps To Reproduce
New WebApi project and add the above Get endpoint to test it
Exceptions (if any)
No response
.NET Version
.net 7.0
Anything else?
ASP.NET Core version: .net 7.0
The text was updated successfully, but these errors were encountered: