class Async::Scheduler

def io_write(io, buffer, length, offset = 0)

@parameter offset [Integer] The offset within the buffer to write from.
@parameter length [Integer] The minimum number of bytes to write.
@parameter buffer [IO::Buffer] The buffer to write from.
@parameter io [IO] The IO object to write to.

@asynchronous May be non-blocking.
@public Since *Async v2* and *Ruby v3.3.1* with `IO::Buffer` support.

Write the specified buffer to the IO.
def io_write(io, buffer, length, offset = 0)
	fiber = Fiber.current
	
	if timeout = get_timeout(io)
		timer = @timers.after(timeout) do
			fiber.raise(::IO::TimeoutError, "Timeout (#{timeout}s) while waiting for IO to become writable!")
		end
	end
	
	@selector.io_write(fiber, io, buffer, length, offset)
ensure
	timer&.cancel!
end