1
0
Fork 0
mirror of https://github.com/thoughtbot/capybara-webkit synced 2023-03-27 23:22:28 -04:00

Make Connection#gets non-blocking

* JRuby Timeout::timeout blocks on IO#gets. IO.connect blocks as well
  unless running in its own thread.
This commit is contained in:
Matthew Horan 2014-07-17 09:35:45 -04:00
parent 8dbf3b8e31
commit cc6b910634

View file

@ -35,7 +35,13 @@ module Capybara::Webkit
end
def gets
@socket.gets
response = ""
while !response.match(/\n/) && Thread.new { IO.select([@socket]) }.join do
response += @socket.read_nonblock(1)
end
response
end
def read(length)