Skip to content

Explore: IO#timeout to get rid of BufferedIO #142

Open
@byroot

Description

@byroot

The whole point of BufferedIO is to be able to perform IO#gets with a timeout. But it requires to copy and slices lots of strings, even though Ruby IOs already have an internal buffer.

Ruby 3.2 introduced IO#timeout, and it applies to gets among other. If it works properly we might be able to get rid of this second layer of buffering in 3.2+.

Things to check:

  • gets
  • getbyte
  • SSLSocket?

If it does work, some other gems may benefit from it, e.g. Net::HTTP etc.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions