Feature #19059
openIntroduce top level `module TimeoutError` for aggregating various timeout error classes.
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 levelclass #{thing}Error
.
Updated by ioquatix (Samuel Williams) about 2 years ago
- Description updated (diff)
Updated by ioquatix (Samuel Williams) about 2 years ago
- Description updated (diff)
Updated by dsisnero (Dominic Sisneros) about 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/
Updated by hsbt (Hiroshi SHIBATA) 9 months ago
- Status changed from Open to Assigned