End of Life Ruby 3.1 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
instance method
ARGF#read_nonblock
ARGF.read_nonblock(maxlen[, options]) → string
ARGF.read_nonblock(maxlen, outbuf[, options]) → outbuf
io.c
View on GitHub ↗
static VALUE
argf_read_nonblock(int argc, VALUE *argv, VALUE argf)
{
VALUE opts;
rb_scan_args(argc, argv, "11:", NULL, NULL, &opts);
if (!NIL_P(opts))
argc--;
return argf_getpartial(argc, argv, argf, opts, 1);
}
Reads at most maxlen bytes from the ARGF stream in non-blocking mode.