Created
September 21, 2012 12:00
-
-
Save roidrage/3761091 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # jruby 1.6/1.7: | |
| Timeout 2 triggered | |
| # ruby 1.9.3-p194 | |
| Timeout 1 triggered |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
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
rubinius 2.0.0dev (1.9.3 d4b69010 yyyy-mm-dd JI) [x86_64-unknown-linux-gnu]
Timeout 2 triggered