module Async
def self.measure(*args, threshold: 1.0, &block)
def self.measure(*args, threshold: 1.0, &block) result = nil duration = Benchmark.realtime do result = yield end return result ensure if duration && duration > threshold warn "#{args.join(' ')} took #{duration}s" end end
def self.run(*args, &block)
def self.run(*args, &block) Reactor.run(*args, &block) end
def default_log_level
def default_log_level if $DEBUG Logger::DEBUG elsif $VERBOSE Logger::INFO else Logger::WARN end end