lib/async/scheduler.rb in async-2.5.0 vs lib/async/scheduler.rb in async-2.5.1

- old
+ new

@@ -177,11 +177,13 @@ if ::IO::Event::Support.buffer? def io_read(io, buffer, length, offset = 0) @selector.io_read(Fiber.current, io, buffer, length, offset) end - def io_write(io, buffer, length, offset = 0) - @selector.io_write(Fiber.current, io, buffer, length, offset) + if RUBY_ENGINE != "ruby" || RUBY_VERSION >= "3.3.0" + def io_write(io, buffer, length, offset = 0) + @selector.io_write(Fiber.current, io, buffer, length, offset) + end end end # Wait for the specified process ID to exit. # @parameter pid [Integer] The process ID to wait for.