class Async::IO::Generic

def wrap_blocking_method(new_name, method_name, invert: true)

Invokes `$2` on the underlying {io}. If the operation would block, the current task is paused until the operation can succeed, at which point it's resumed and the operation is completed.
@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