Skip to content

Instantly share code, notes, and snippets.

@schneems
Created April 10, 2015 18:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save schneems/fb1e27f5847cfc2ba5f4 to your computer and use it in GitHub Desktop.
Save schneems/fb1e27f5847cfc2ba5f4 to your computer and use it in GitHub Desktop.
Thread.new do
begin
while true
sleep
end
ensure
puts "it's a TRAP"
end
end
Process.kill("TERM", Process.pid)
# => it's a TRAP
# => Terminated: 15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment