Skip to content

IAsyncEnumerable buffer the results and not yield it as stream. #45916

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
1 task done
aristotelis79 opened this issue Jan 6, 2023 · 3 comments
Closed
1 task done

IAsyncEnumerable buffer the results and not yield it as stream. #45916

aristotelis79 opened this issue Jan 6, 2023 · 3 comments
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

Comments

@aristotelis79
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

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

@mkArtakMSFT mkArtakMSFT added the old-area-web-frameworks-do-not-use *DEPRECATED* This label is deprecated in favor of the area-mvc and area-minimal labels label Jan 6, 2023
@brunolins16
Copy link
Member

@aristotelis79 I believe it is related to dotnet/sdk#29152. Can you please confirm if the issue does not reproduce when dotnet run?

@brunolins16 brunolins16 added the Needs: Author Feedback The author of this issue needs to respond in order for us to continue investigating this issue. label Jan 6, 2023
@ghost
Copy link

ghost commented Jan 6, 2023

Hi @aristotelis79. We have added the "Needs: Author Feedback" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

@aristotelis79
Copy link
Author

Hi @brunolins16,
You are right. The bug has to be with the visual studio. I try it with dotnet run and I can't reproduce it.

@ghost ghost locked as resolved and limited conversation to collaborators Feb 6, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
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
Projects
None yet
Development

No branches or pull requests

3 participants