class Async::Reactor
def block(blocker, timeout)
def block(blocker, timeout) fiber = Fiber.current if timeout timer = @timers.after(timeout) do if fiber.alive? fiber.resume(false) end end end begin @blocked += 1 Fiber.yield ensure @blocked -= 1 end ensure timer&.cancel end