Skip to content

Conversation

@davidfowl
Copy link
Member

@davidfowl davidfowl commented Apr 28, 2021

  • Implemented the PipeReader implementation and override the method on Pipe.
  • The Pipe implementation has some caveats. Calling ReadAtLeast messes with the pipe back pressure since it's trying to prevent deadlocks. This means that if ReadAsync is called with a big threshold, the writer will write as fast as it can ignoring the PauseThreshold up until the reader is unblocked. In a sense, the call to ReadAtLeast async overrides the pause threshold for that one read.
  • Added tests
  • Added missing StreamConformance tests to the solution so it would build

Fixes #25063

PS: I need some more default implementation tests. Done

- Implemented the PipeReader implementation and override the method on Pipe.
- The Pipe implementation has some caveats. Calling ReadAtLeast messes with the pipe back pressure since it's trying to prevent deadlocks. This means that if ReadAsync is called with a big threshold, the writer will write as fast as it can ignoring the PauseThreshold up until the reader is unblocked. In a sense, the call to ReadAtLeast async overrides the pause threshold for that one read.
- Added tests
- Added missing StreamConformance tests to the solution so it would build
@ghost
Copy link

ghost commented Apr 28, 2021

Note regarding the new-api-needs-documentation label:

This serves as a reminder for when your PR is modifying a ref *.cs file and adding/modifying public APIs, to please make sure the API implementation in the src *.cs file is documented with triple slash comments, so the PR reviewers can sign off that change.

- Flip the reading state off when we decide not to accept the read
@davidfowl
Copy link
Member Author

Looked at the failures and they are unrelated.

@davidfowl
Copy link
Member Author

@davidfowl davidfowl merged commit a46f7e9 into main May 1, 2021
@jkotas jkotas deleted the davidfowl/minimum-read-length branch May 3, 2021 14:59
@karelz karelz added this to the 6.0.0 milestone May 20, 2021
@ghost ghost locked as resolved and limited conversation to collaborators Jun 19, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

API Proposal: Add PipeReader.ReadAsync overloads to allow waiting for a specific amount of data

7 participants