aboutsummaryrefslogtreecommitdiffstats
path: root/io.c
diff options
context:
space:
mode:
authorzverok <zverok.offline@gmail.com>2023-02-15 22:16:43 +0200
committerVictor Shepelev <zverok.offline@gmail.com>2023-02-19 22:32:52 +0200
commit4f049e915d08697ee9fea5d2c885285d309a7654 (patch)
treef113b666813b653c58db824ff86d5ce9863988a3 /io.c
parente1b447a32304495e1379d154758130a8be530bfb (diff)
downloadruby-4f049e915d08697ee9fea5d2c885285d309a7654.tar.gz
[DOC] Document IO::Timeout
Diffstat (limited to 'io.c')
-rw-r--r--io.c6
1 files changed, 5 insertions, 1 deletions
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));