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:
parent
8dbf3b8e31
commit
cc6b910634
1 changed files with 7 additions and 1 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue