# File lib/active_record/fiber_patches.rb, line 32 def signal fiber = @queue.pop fiber.resume(true) if fiber end
# File lib/active_record/fiber_patches.rb, line 19 def wait(timeout) t = timeout || 5 fiber = Fiber.current x = EM::Timer.new(t) do @queue.delete(fiber) fiber.resume(false) end @queue << fiber Fiber.yield.tap do x.cancel end end
# File lib/active_record/fiber_patches.rb, line 15 def initialize @queue = [] end