class Async::Reactor
def self.run(*args, &block)
def self.run(*args, &block) if current = Task.current? reactor = current.reactor reactor.async(*args, &block) else reactor = self.new begin reactor.run(*args, &block) ensure reactor.close end return reactor end end