class Async::IO::Generic
def wrap_blocking_method(new_name, method_name, invert: true)
@method $1
@!macro [attach] wrap_blocking_method
def wrap_blocking_method(new_name, method_name, invert: true) define_method(new_name) do |*args| async_send(method_name, *args) end if invert # We define the original _nonblock method to call the async variant. We ignore options. # define_method(method_name) do |*args, **options| # self.__send__(new_name, *args) # end def_delegators :@io, method_name end end