diff options
-rw-r--r-- | io.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -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)); |