Project

General

Profile

Actions

Feature #19059

open

Introduce top level `module TimeoutError` for aggregating various timeout error classes.

Added by ioquatix (Samuel Williams) about 2 years ago. Updated 7 months ago.

Status:
Assigned
Target version:
-
[ruby-core:110303]

Description

This proposal was originally part of https://bugs.ruby-lang.org/issues/18630 but was removed because we could not decide on the name.

Introduce the following:

module TimeoutError
end

IO::TimeoutError.include(TimeoutError)
Regexp::TimeoutError.include(TimeoutError)
# Maybe?
Timeout::Error.include(TimeoutError)

It may be easier for users.

This was discussed before with the following conclusion:

  • Top level TimeoutError is available.
  • Using a module for a TimeoutError may not be consistent with other top level class #{thing}Error.
Actions #1

Updated by ioquatix (Samuel Williams) about 2 years ago

  • Description updated (diff)
Actions #2

Updated by ioquatix (Samuel Williams) about 2 years ago

  • Description updated (diff)

Updated by dsisnero (Dominic Sisneros) almost 2 years ago

Lots of other languages are starting accept cancellation by using cancel tokens and have timeout a subclass of a Cancelation Error. This is because, sometimes you want to let cancel a task because of timeout, or because of user cancel request, or because of a race between asyn tasks like in golang select or concurrent ml choose. I think this and https://bugs.ruby-lang.org/issues/18630 should consider having something more general than timeout .

https://vorpus.org/blog/timeouts-and-cancellation-for-humans/

Actions #4

Updated by hsbt (Hiroshi SHIBATA) 7 months ago

  • Status changed from Open to Assigned
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0