From 4adb79f8aaddba977eac52600dffa5b5610ced39 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Tue, 4 Nov 2025 18:03:47 +0900 Subject: [ruby/io-wait] Deprecate `IO#nread` and `IO#ready?` To use these methods, busy loop is necessary somewhere. Use other method to wait instead. https://github.com/ruby/io-wait/commit/8ff4821cea --- ext/io/wait/wait.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ext/io/wait/wait.c b/ext/io/wait/wait.c index bec04cb727..d9653e9c34 100644 --- a/ext/io/wait/wait.c +++ b/ext/io/wait/wait.c @@ -83,6 +83,7 @@ io_nread(VALUE io) int len; ioctl_arg n; + rb_category_warn(RB_WARN_CATEGORY_DEPRECATED, "IO#nread is deprecated; use wait_readable instead"); GetOpenFile(io, fptr); rb_io_check_char_readable(fptr); len = rb_io_read_pending(fptr); @@ -142,6 +143,7 @@ io_ready_p(VALUE io) struct timeval tv = {0, 0}; #endif + rb_category_warn(RB_WARN_CATEGORY_DEPRECATED, "IO#ready? is deprecated; use wait_readable instead"); GetOpenFile(io, fptr); rb_io_check_char_readable(fptr); if (rb_io_read_pending(fptr)) return Qtrue; -- cgit v1.2.3