class Async::IO::Generic
def wrap_blocking_method(new_name, method_name, invert: true, &block)
@method $1
@!macro [attach] wrap_blocking_method
def wrap_blocking_method(new_name, method_name, invert: true, &block) if block_given? define_method(new_name, &block) else define_method(new_name) do |*args| async_send(method_name, *args) end end if invert # We wrap the original _nonblock method, ignoring options. define_method(method_name) do |*args, exception: false| async_send(method_name, *args) end end end