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

Use the exception: false API of read/write nonblock #926

Merged
merged 1 commit into from Sep 27, 2020

Conversation

casperisfine
Copy link

Should be a nice optimization, just need to make sure it doesn't break anything (Errno::EAGAIN ,Errno::EWOULDBLOCK in connect is fishy).

@casperisfine casperisfine force-pushed the read-nonblock-exception branch 2 times, most recently from ea20ed9 to 6e21016 Compare June 17, 2020 16:40
@casperisfine casperisfine changed the title Use the exception: false API of read/write/connect nonblock Use the exception: false API of read/write nonblock Sep 27, 2020
@casperisfine
Copy link
Author

The connect_noblock is a bit trickier to handle, so I reduce the PR to just read and write.

@byroot byroot merged commit 9e389de into redis:master Sep 27, 2020
@casperisfine casperisfine deleted the read-nonblock-exception branch September 27, 2020 09:23
loop do
case bytes_written = write_nonblock(data, exception: false)
when :wait_readable
unless IO.select([self], nil, nil, @timeout)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this still use @write_timeout (and not @timeout)?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed. Good catch.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 087a11b

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

4 participants