Skip to content

Instantly share code, notes, and snippets.

@roidrage
Created September 21, 2012 12:00
Show Gist options
  • Select an option

  • Save roidrage/3761091 to your computer and use it in GitHub Desktop.

Select an option

Save roidrage/3761091 to your computer and use it in GitHub Desktop.
# jruby 1.6/1.7:
Timeout 2 triggered
# ruby 1.9.3-p194
Timeout 1 triggered
require 'timeout'
begin
Timeout.timeout(1) do
begin
Timeout.timeout(2) do
sleep(5)
end
rescue Timeout::Error
puts 'Timeout 2 triggered'
end
end
rescue Timeout::Error
puts 'Timeout 1 triggered'
end
@LTe

LTe commented Sep 21, 2012

Copy link
Copy Markdown

rubinius 2.0.0dev (1.9.3 d4b69010 yyyy-mm-dd JI) [x86_64-unknown-linux-gnu]

Timeout 2 triggered

@jlecour

jlecour commented Sep 21, 2012

Copy link
Copy Markdown

Very interesting. I'm really curious of the reasons each one of those possible outcomes would be the "one and only logical one".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment