Skip to content

Maintenance Ruby 3.4 gets fixes, but no new features. Switch to Ruby 4.0 →

instance method

IO#nonblock

io.nonblock {|io| } → object
io.nonblock(boolean) {|io| } → object

Yields self in non-blocking mode.

When false is given as an argument, self is yielded in blocking mode. The original mode is restored after the block is executed.

See also #nonblock= #nonblock? #noecho #lineno= also in 4.1 · 4.0 · 3.3 · 3.2 · 3.1 · 3.0