From 4f049e915d08697ee9fea5d2c885285d309a7654 Mon Sep 17 00:00:00 2001 From: zverok Date: Wed, 15 Feb 2023 22:16:43 +0200 Subject: [DOC] Document IO::Timeout --- io.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'io.c') diff --git a/io.c b/io.c index dbcfcf3fc0..fc554b4563 100644 --- a/io.c +++ b/io.c @@ -852,9 +852,12 @@ rb_io_timeout(VALUE self) * timeout = duration -> duration * timeout = nil -> nil * - * Set the internal timeout to the specified duration or nil. The timeout + * \Set the internal timeout to the specified duration or nil. The timeout * applies to all blocking operations where possible. * + * When the operation performs longer than the timeout set, IO::TimeoutError + * is raised. + * * This affects the following methods (but is not limited to): #gets, #puts, * #read, #write, #wait_readable and #wait_writable. This also affects * blocking socket operations like Socket#accept and Socket#connect. @@ -15316,6 +15319,7 @@ Init_IO(void) rb_cIO = rb_define_class("IO", rb_cObject); rb_include_module(rb_cIO, rb_mEnumerable); + /* Can be raised by IO operations when IO#timeout= is set. */ rb_eIOTimeoutError = rb_define_class_under(rb_cIO, "TimeoutError", rb_eIOError); rb_define_const(rb_cIO, "READABLE", INT2NUM(RUBY_IO_READABLE)); -- cgit v1.2.1