Skip to content
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

Implement ReadAtLeastAsync in StreamPipeReader #52150

Closed
davidfowl opened this issue May 1, 2021 · 0 comments · Fixed by #52246
Closed

Implement ReadAtLeastAsync in StreamPipeReader #52150

davidfowl opened this issue May 1, 2021 · 0 comments · Fixed by #52246
Assignees
Labels
area-System.IO.Pipelines help wanted [up-for-grabs] Good issue for external contributors
Milestone

Comments

@davidfowl
Copy link
Member

davidfowl commented May 1, 2021

Description

As a follow up to this change, override ReadAtLeastAsyncCore on StreamPipeReader. This implementation should loop in place until the the amount of buffered bytes is >= the minimumSize. There might also be an opportunity to increase the segment size based on the minimumSize. For example:

PipeReader reader = PipeReader.Create(networkStream);
ReadResult result = await reader.ReadAtLeastAsync(16 * 1024);

Normally, this would return 4 4K buffers, but we could choose here to allocate a single 16K segment. Obviously we don't want to allocate large segments we can cap the buffer at some maximum size.

@dotnet-issue-labeler dotnet-issue-labeler bot added the untriaged New issue has not been triaged by the area owner label May 1, 2021
@davidfowl davidfowl added the help wanted [up-for-grabs] Good issue for external contributors label May 1, 2021
@BrennanConroy BrennanConroy removed the untriaged New issue has not been triaged by the area owner label May 3, 2021
@BrennanConroy BrennanConroy added this to the Future milestone May 3, 2021
@ghost ghost added the in-pr There is an active PR which will close this issue when it is merged label May 4, 2021
@davidfowl davidfowl modified the milestones: Future, 6.0.0 May 7, 2021
@ghost ghost removed the in-pr There is an active PR which will close this issue when it is merged label May 10, 2021
@davidfowl davidfowl self-assigned this May 10, 2021
@ghost ghost locked as resolved and limited conversation to collaborators Jun 9, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-System.IO.Pipelines help wanted [up-for-grabs] Good issue for external contributors
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants