diff options
author | zverok <zverok.offline@gmail.com> | 2023-02-15 22:16:43 +0200 |
---|---|---|
committer | Victor Shepelev <zverok.offline@gmail.com> | 2023-02-19 22:32:52 +0200 |
commit | 4f049e915d08697ee9fea5d2c885285d309a7654 (patch) | |
tree | f113b666813b653c58db824ff86d5ce9863988a3 /io.c | |
parent | e1b447a32304495e1379d154758130a8be530bfb (diff) |
[DOC] Document IO::Timeout
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/7316
Diffstat (limited to 'io.c')
-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)); |