summaryrefslogtreecommitdiff
path: root/lib/timeout.rb
AgeCommit message (Collapse)Author
2021-10-14[ruby/timeout] Bump up timeout version to 0.2.0Hiroshi SHIBATA
https://github.com/ruby/timeout/commit/02e792ddd8
2021-09-27[ruby/timeout] Freeze VERSIONrm155
https://github.com/ruby/timeout/commit/ac7b010c41
2021-05-06[ruby/timeout] Only run timeout_after hook on fiber scheduler if scheduler ↵Jeremy Evans
exists https://github.com/ruby/timeout/commit/4893cde0ed
2021-05-06[ruby/timeout] Avoid unnecessary object allocationJeremy Evans
Idea from nobu. https://github.com/ruby/timeout/commit/aecdaa23b3
2021-05-06[ruby/timeout] Make Timeout::Error#exception with multiple arguments not ↵Jeremy Evans
ignore arguments This makes: raise(Timeout::Error.new("hello"), "world") raise a TimeoutError instance with "world" as the message instead of "hello", for consistency with other Ruby exception classes. This required some internal changes to keep the tests passing. Fixes [Bug #17812] https://github.com/ruby/timeout/commit/952154dbf9
2021-03-30Fix handling of timeout accessing scheduler outside of non-blocking context.Samuel Williams
Notes: Merged: https://github.com/ruby/ruby/pull/4173
2021-03-30Update method name and add documentation.Samuel Williams
Notes: Merged: https://github.com/ruby/ruby/pull/4173
2021-03-30Update lib/timeout.rbSamuel Williams
Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org> Notes: Merged: https://github.com/ruby/ruby/pull/4173
2021-03-30Add hook for `Timeout.timeout`.Samuel Williams
Notes: Merged: https://github.com/ruby/ruby/pull/4173
2021-01-03[ruby/timeout] Removed deprecated names that had been warned for 5 yearsNobuyoshi Nakada
https://github.com/ruby/timeout/commit/f9a9758a41
2020-12-22Update library versions of the default gems.Hiroshi SHIBATA
They are followed up with https://github.com/ruby/ruby/commit/8fb02b7a97317090e3946e6f2d4a7d034f9699f1
2020-07-30Extract version number from the sourceNobuyoshi Nakada
"requiring version.rb" strategy has some issues. - cannot work when cross-compiling - often introduces wrong namespace - must know the superclasses - costs at each runtime than at build-time etc. Notes: Merged: https://github.com/ruby/ruby/pull/3375
2019-06-04Add some documentation to Timeout#timeout about possible issuesJeremy Evans
Documentation requested in [Bug #15886].
2017-12-12Add uplevel keyword to Kernel#warn and use itshyouhei
If uplevel keyword is given, the warning message is prepended with caller file and line information and the string "warning: ". The use of the uplevel keyword makes Kernel#warn format output similar to how rb_warn formats output. This patch modifies net/ftp and net/imap to use Kernel#warn instead of $stderr.puts or $stderr.printf, since they are used for printing warnings. This makes lib/cgi/core and tempfile use $stderr.puts instead of warn for debug logging, since they are used for debug printing and not for warning. This does not modify bundler, rubygems, or rdoc, as those are maintained outside of ruby and probably wish to remain backwards compatible with older ruby versions. rb_warn_m code is originally from nobu, but I've changed it so that it only includes the path and lineno from uplevel (not the method), and also prepends the string "warning: ", to make it more similar to rb_warn. From: Jeremy Evans code@jeremyevans.net Signed-off-by: Urabe Shyouhei shyouhei@ruby-lang.org git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61155 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-17Fix typo in `Timeout` doc [ci skip]kazu
Author: yuuji.yaginuma <yuuji.yaginuma@gmail.com> https://github.com/ruby/ruby/pull/1760 [Fix GH-1760] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60827 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-09-07fix a typo [ci skip]kazu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56092 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-09-07timeout.rb: custom error messagenobu
* lib/timeout.rb (Timeout#timeout): add custom error message argument. [Feature #11650] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56089 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-18timeout.rb: watcher thread namenobu
* lib/timeout.rb (Timeout#timeout): set watcher thread name to caller location for debugging. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53195 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-16Add frozen_string_literal: false for all filesnaruse
When you change this to true, you may need to add more tests. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53141 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-08-13timeout.rb: freeze a string messagenobu
* lib/timeout.rb (Timeout#timeout): freeze a string message to reduce string allocations. [Fix GH-996] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51566 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-30variable.c: Module#deprecate_constantnobu
* variable.c (rb_const_get_0): warn deprecated constant reference. * variable.c (rb_mod_deprecate_constant): mark constants to be warned as deprecated. [Feature #11398] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51444 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-14timeout.rb: suppress a warningnobu
* lib/timeout.rb (Timeout): get rid of an argument prefix warning. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51236 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-13timeout.rb: warn deprecated methodnobu
* lib/timeout.rb (timeout): warn as deprecated for a long time. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51226 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-13timeout.rb: internal constantsnobu
* lib/timeout.rb (Timeout): make internal constants private. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51224 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-11timeout.rb: fix backtracenobu
* lib/timeout.rb (Timeout#timeout): remove regexp with wrong line nuber and fix caller depth. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51216 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-10timeout.rb: removed and use Timeout::Errornobu
* lib/timeout.rb (ExitException): removed internal exception class and use Timeout::Error instead, as using throw/catch to isolate each timeouts now. [ruby-dev:49179] [Bug #11344] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51213 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-17timeout.rb: same object across fibernobu
* lib/timeout.rb (Timeout::ExitException.catch): do not freeze the exception for tag, so that the same object can be passed to the target fiber without duplication to attach backtrace at raise. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48467 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-16timeout.rb: use UncaughtThrowErrornobu
* lib/timeout.rb (Timeout::ExitException#exception): rescue UncaughtThrowError which is specific for throw, instead of ArgumentError. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48460 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-08lib/timeout.rb: fallback to Timeout::Errornobu
* lib/timeout.rb (Timeout::ExitException.catch): pass arguments for new instance. * lib/timeout.rb (Timeout::ExitException#exception): fallback to Timeout::Error if couldn't throw. [ruby-dev:47872] [Bug #9380] * lib/timeout.rb (Timeout#timeout): initialize ExitException with message for the fallback case. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44523 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-07timeout.rb: revert r44520nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44521 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-07timeout.rb: current_targetnobu
* lib/timeout.rb (Timeout::ExitException#target): rename attribute. * lib/timeout.rb (Timeout::ExitException.current_target): extract a method to achieve the target. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44520 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-07timeout.rb: unused attributenobu
* lib/timeout.rb (Timeout::ExitException): remove unused attribute, klass. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44519 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-07timeout.rb: fix for ExitExceptionnobu
* lib/timeout.rb (Timeout#timeout): should not rescue ordinarily raised ExitException, which should not be thrown. * lib/timeout.rb (Timeout::ExitException.catch): set @thread only if it ought to be caught. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44518 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-07timeout.rb: defer creating custom exceptionnobu
* lib/timeout.rb (Timeout#timeout): when a custom exception is given, no instance is needed to be caught, so defer creating new instance until it is raised. [ruby-core:59511] [Bug #9354] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44517 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-10* lib/timeout.rb: Added note about change from #8730 [Fixes GH-440]zzak
* NEWS: Improve grammar on change to Timeout Patched by @srawlins in https://github.com/ruby/ruby/pull/440 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43640 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-08-27timeout.rb: raise given exceptionnobu
* lib/timeout.rb (Timeout#timeout): skip rescue clause only when no exception class is given. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42710 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-08-26timeout.rb: skip rescuenobu
* lib/timeout.rb (Timeout#timeout): should not be caught by rescue clause. [Bug #8730] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42690 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-03-31doumentation by @toolmantim [GH fixes #270]hsbt
* timeout.rb: Document Timeout::timeout 0 and nil argument behavior git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40015 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-07Revert r38216 and r38221. Release manager mark this feature as "next minor".kosaki
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38260 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-07timeout.rb: replace deferred exception after async_interrupt_timingnobu
* lib/timeout.rb (Timeout#timeout): since async_interrupt_timing re-raises a deferred exception, replace the timeout exception with Timeout::Error after it. [Bug #7503] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38255 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-05 * lib/timeout.rb (Timeout#timeout): specify a exceptiontarui
more strictly at async_interrupt_timing. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38221 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-05adjust style and fix typo and indentkazu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38220 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-05* lib/timeout.rb (Timeout#timeout): setkosaki
async_interrupt_timeing(:on_blocking) by default. [Bug #7503] [ruby-core:50524] * test/test_timeout.rb (#test_timeout_blocking): test for the above. * test/test_timeout.rb (test_timeout_immediate): ditto * test/test_timeout.rb (test_timeout_immediate2): ditto. * NEWS: news for the above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38216 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-11* lib/timeout.rb (timeout):zzak
Remove paragraph on wrong implementation detail. [ruby-core:47739] [Bug #7088] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37145 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-16 * lib/timeout.rb: Clarify timeout duration types. Patch by Alf Mikula.drbrain
[Ruby 1.9 - Bug #4791] * lib/net/http.rb: ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32116 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-22 * lib/timeout.rb: Improve documentation. Patch by David Copeland.drbrain
[Ruby 1.9 - Bug #4755] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31687 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-18* lib/timeout.rb (Timeout#timeout): don't leak "execution expired"kosaki
exception. [Bug #4283] [ruby-core:34534]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31623 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-16 * lib/timeout.rb (module Timeout): Hide internal constants. Patch bydrbrain
Pete Higgins. [Ruby 1.9 - Bug #4701] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31592 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-19* lib/timeout.rb (Timeout#timeout): propagate errors to thenobu
caller. [ruby-dev:41010]' git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27395 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-11* sample/timeout.rb: split from lib/timeout.rb.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26877 b2dd03c8-39d4-4d8f-98ff-823fe69b080e