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

Draft: Replace bypass BufferedIO when IO#timeout is available #150

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

casperisfine
Copy link
Collaborator

Ruby IOs have an internal buffer already, the only reason we have to buffer again ourselves is to be able to timeout on IO#gets.

With IO#timeout being introduced in Ruby 3.2, we can get rid of the second buffer.

This is just a PoC, there is a handful of test failures, I just wanted to explore.

FYI: @ioquatix

One discovered issue is that we can't do that with SSLSocket: ruby/openssl#693, to be explored further.

Ruby IOs have an internal buffer already, the only reason we have
to buffer again ourselves is to be able to timeout on `IO#gets`.

With `IO#timeout` being introduced in Ruby 3.2, we can get rid
of the second buffer.

This is just a PoC, there is a handful of test failures, I just
wanted to explore.
@casperisfine
Copy link
Collaborator Author

This OpenSSL limitation was fixed: ruby/openssl#714

Not sure when I'll get back to this, but we should have a path forward now.

@ioquatix
Copy link

It’s awesome to see this is useful.

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.

3 participants