Skip to content

Instantly share code, notes, and snippets.

@bricker
Created March 8, 2014 01:48
Show Gist options
  • Save bricker/9423971 to your computer and use it in GitHub Desktop.
Save bricker/9423971 to your computer and use it in GitHub Desktop.
TERM_HANDLERS = [
-> { puts "AAAAAA" },
-> { puts "BBBBBB" }
]
Signal.trap "TERM" do |s|
TERM_HANDLERS.each { |h| h.call }
exit
end
TERM_HANDLERS << -> { puts "CCCCCC" }
sleep
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment