Project

General

Profile

Actions

Bug #22328

open

Should IO#wait_priority be deprecated and then removed?

Bug #22328: Should IO#wait_priority be deprecated and then removed?

Added by sampokuokkanen (Sampo Kuokkanen) 3 months ago. Updated about 1 month ago.

Status:
Open
Assignee:
-
Target version:
-
[ruby-core:126756]

Description

In #18655, IO#wait_readable, IO#wait_writable, IO#wait_priority, and IO#wait were moved from io/wait into core.

However, in #18655 note 11, Matz wrote:

After the discussion, we will drop wait_priority, but others are accepted.
https://bugs.ruby-lang.org/issues/18655#note-11
https://github.com/ruby/dev-meeting-log/blob/d16be491afb7f3c0d956a6445dcb17d3a87131b1/2022/DevMeeting-2022-07-21.md?plain=1#L360

IO#wait_priority is still present in core today.

It does not seem to be used that much:
https://github.com/search?type=code&q=.wait_priority+language%3ARuby&l=Ruby

So my question is, should it be deprecated and removed?

Updated by matz (Yukihiro Matsumoto) about 2 months ago Actions #1 [ruby-core:126969]

You are right, it was left by mistake. Let's deprecate IO#wait_priority in 4.1 with a warning and remove it in a later release. io.wait(IO::PRIORITY, timeout) does the same thing.

Matz.

Updated by sampokuokkanen (Sampo Kuokkanen) about 1 month ago Actions #2 [ruby-core:127245]

I opened https://github.com/ruby/ruby/pull/19548 for this.

It makes IO#wait_priority emit a deprecation warning (shown when Warning[:deprecated] is enabled) pointing to IO#wait(IO::PRIORITY, timeout), and adds a NEWS entry.

The warning doesn't name a removal version yet. If we decide on one (e.g. 4.2), I'll change it to say "will be removed in Ruby X.Y".

Actions

Also available in: PDF Atom