about summary refs log tree commit homepage
path: root/lib/rainbows/fiber/io.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rainbows/fiber/io.rb')
-rw-r--r--lib/rainbows/fiber/io.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/rainbows/fiber/io.rb b/lib/rainbows/fiber/io.rb
index e96f4de..94996ee 100644
--- a/lib/rainbows/fiber/io.rb
+++ b/lib/rainbows/fiber/io.rb
@@ -82,7 +82,7 @@ class Rainbows::Fiber::IO
         case rv = @to_io.kgio_tryread(16384, buf)
         when :wait_readable
           return if expire && expire < Time.now
-          expire ||= Time.now + G.kato
+          expire ||= read_expire
           kgio_wait_readable
         else
           return rv
@@ -93,7 +93,7 @@ class Rainbows::Fiber::IO
         return @to_io.read_nonblock(16384, buf)
       rescue Errno::EAGAIN
         return if expire && expire < Time.now
-        expire ||= Time.now + G.kato
+        expire ||= read_expire
         kgio_wait_readable
       end while true
     end