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

Replace bufio-based data reader with a state machine. #9

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

fluffle
Copy link

@fluffle fluffle commented Sep 6, 2018

Hi!

I tried to use your code and it kept doing blocking reads. Here's a fix. I only gofmt'd the files I changed, and I kept the format changes in a separate commit to make reviewing this change easier.

Cheers,
--alex

This state machine guarantees that at most one Read will be issued to
the underlying reader for every internalDataReader Read call. Preserving
these semantics stops internalDataReader from blocking when the provided
read buffer is larger than the amount of data available to read from the
underlying reader.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant