diff options
| author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2025-11-04 18:03:47 +0900 |
|---|---|---|
| committer | git <svn-admin@ruby-lang.org> | 2025-11-12 13:23:12 +0000 |
| commit | 4adb79f8aaddba977eac52600dffa5b5610ced39 (patch) | |
| tree | 5c15fdef74d6840f0169bc58ed4c631a1c10d319 | |
| parent | edb8296b991a0d6e2522511835315b10b846aef2 (diff) | |
[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
| -rw-r--r-- | ext/io/wait/wait.c | 2 |
1 files changed, 2 insertions, 0 deletions
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; |
