diff options
Diffstat (limited to 'lib/rainbows')
-rw-r--r-- | lib/rainbows/client.rb | 7 | ||||
-rw-r--r-- | lib/rainbows/fiber/coolio/methods.rb | 2 | ||||
-rw-r--r-- | lib/rainbows/fiber/io/methods.rb | 2 |
3 files changed, 3 insertions, 8 deletions
diff --git a/lib/rainbows/client.rb b/lib/rainbows/client.rb index cc02c0b..d8a30b2 100644 --- a/lib/rainbows/client.rb +++ b/lib/rainbows/client.rb @@ -1,6 +1,5 @@ # -*- encoding: binary -*- # :enddoc: -require "io/wait" # this class is used for most synchronous concurrency models class Rainbows::Client < Kgio::Socket @@ -11,10 +10,6 @@ class Rainbows::Client < Kgio::Socket Time.now + KEEPALIVE_TIMEOUT end - def kgio_wait_readable - wait KEEPALIVE_TIMEOUT - end - # used for reading headers (respecting keepalive_timeout) def timed_read(buf) expire = nil @@ -23,7 +18,7 @@ class Rainbows::Client < Kgio::Socket when :wait_readable return if expire && expire < Time.now expire ||= read_expire - kgio_wait_readable + kgio_wait_readable(KEEPALIVE_TIMEOUT) else return rv end diff --git a/lib/rainbows/fiber/coolio/methods.rb b/lib/rainbows/fiber/coolio/methods.rb index 2e664ff..a327148 100644 --- a/lib/rainbows/fiber/coolio/methods.rb +++ b/lib/rainbows/fiber/coolio/methods.rb @@ -28,7 +28,7 @@ module Rainbows::Fiber::Coolio::Methods @w.disable end - def kgio_wait_readable + def kgio_wait_readable(timeout = nil) @r = Watcher.new(self, :r) unless defined?(@r) @r.enable unless @r.enabled? Fiber.yield diff --git a/lib/rainbows/fiber/io/methods.rb b/lib/rainbows/fiber/io/methods.rb index 9df0f01..e490818 100644 --- a/lib/rainbows/fiber/io/methods.rb +++ b/lib/rainbows/fiber/io/methods.rb @@ -29,7 +29,7 @@ module Rainbows::Fiber::IO::Methods super end - def kgio_wait_readable + def kgio_wait_readable(timeout = nil) fd = fileno @f = Fiber.current RD[fd] = self |