diff options
Diffstat (limited to 'lib/rainbows/fiber/io/methods.rb')
-rw-r--r-- | lib/rainbows/fiber/io/methods.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/rainbows/fiber/io/methods.rb b/lib/rainbows/fiber/io/methods.rb index 6c4d44d..29c9854 100644 --- a/lib/rainbows/fiber/io/methods.rb +++ b/lib/rainbows/fiber/io/methods.rb @@ -8,8 +8,13 @@ module Rainbows::Fiber::IO::Methods RD = Rainbows::Fiber::RD WR = Rainbows::Fiber::WR + ZZ = Rainbows::Fiber::ZZ attr_accessor :f + def read_expire + ZZ[Fiber.current] = super + end + # for wrapping output response bodies def each(&block) if buf = kgio_read(16384) @@ -30,6 +35,7 @@ module Rainbows::Fiber::IO::Methods @f = Fiber.current RD[fd] = self Fiber.yield + ZZ.delete @f RD[fd] = nil end |