Created
September 15, 2012 05:38
-
-
Save jjb/3726473 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
t = Thread.start{ | |
begin | |
puts "starting executing code!" | |
sleep 1 | |
puts "done executing code!" # we don't expect to reach here | |
rescue Exception | |
puts "rescuing!" # we don't expect to reach here | |
ensure | |
puts "ensuring!" # will we reach here????? (yes) | |
end | |
} | |
t.kill | |
t.join | |
puts "done!" |
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
➔ ruby ../thing.rb | |
ensuring! | |
done! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment