Skip to content

Commit

Permalink
Add advice around timeout handling to rb_io_maybe_wait.
Browse files Browse the repository at this point in the history
  • Loading branch information
ioquatix committed Jan 14, 2024
1 parent 55335ea commit 37b0905
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions include/ruby/io.h
Original file line number Diff line number Diff line change
Expand Up @@ -964,6 +964,9 @@ VALUE rb_io_wait(VALUE io, VALUE events, VALUE timeout);
* }
* ```
*
* On timeout, ::RUBY_Qfalse is returned. Unless you are specifically handling
* the timeouts, you should typically raise ::rb_eIOTimeoutError in this case.
*
* @param[in] error System errno.
* @param[in] io An IO object to wait.
* @param[in] events An integer set of interests.
Expand All @@ -974,10 +977,6 @@ VALUE rb_io_wait(VALUE io, VALUE events, VALUE timeout);
* @retval RUBY_Qfalse Operation timed out.
* @retval Otherwise Actual events reached.
*
* @internal
*
* This function to return ::RUBY_Qfalse on timeout could be unintended. It
* seems timeout feature has some rough edge.
*/
VALUE rb_io_maybe_wait(int error, VALUE io, VALUE events, VALUE timeout);

Expand Down

0 comments on commit 37b0905

Please sign in to comment.