Skip to content

Commit

Permalink
Use the approach recommended by the Ruby OpenSSL folks - ruby/openssl…
Browse files Browse the repository at this point in the history
  • Loading branch information
petergoldstein committed Oct 26, 2021
1 parent 08c5003 commit 326b45a
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions lib/dalli/socket.rb
Expand Up @@ -50,12 +50,16 @@ def options
io.options
end

def wait_readable(timeout)
IO.select([self], nil, nil, timeout)
unless method_defined?(:wait_readable)
def wait_readable(timeout = nil)
to_io.wait_readable(timeout)
end
end

def wait_writable(timeout)
IO.select(nil, [self], nil, timeout)
unless method_defined?(:wait_writable)
def wait_writable(timeout = nil)
to_io.wait_writable(timeout)
end
end
end

Expand Down

0 comments on commit 326b45a

Please sign in to comment.