Navigation Menu

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

Excon::Socket.readline to use buffered reads #720

Merged
merged 1 commit into from Jun 23, 2020

Conversation

kryzthov-stripe
Copy link
Contributor

Excon::Socket.readline currently reads 1 byte at a time,
by performing one syscall for each byte (through ::Socket::read_nonblock).
This change proposes to use the private Excon::Socket.read_nonblock primitive
instead, to benefit from the read buffer.

Tests & specs seem to run fine with this change.

`Excon::Socket.readline` currently reads 1 byte at a time,
by performing one syscall for each byte (through `::Socket::read_nonblock`).
This change proposes to use the private `Excon::Socket.read_nonblock` primitive
instead, to benefit from the read buffer.

Tests & specs seem to run fine with this change.
@geemus
Copy link
Contributor

geemus commented Jun 23, 2020

Sorry for the delay, I was just a bit anxious as it feels like a bigger/more risky change. I think it should be fine though, as you suggest. Thanks for noticing this, it is nice to remove some of the non-block error handling duplication as well.

@geemus geemus merged commit 13ac7b4 into excon:master Jun 23, 2020
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.

None yet

2 participants