Skip to content

Instantly share code, notes, and snippets.

@pbosetti
Created April 21, 2011 00:16
Show Gist options
  • Save pbosetti/933395 to your computer and use it in GitHub Desktop.
Save pbosetti/933395 to your computer and use it in GitHub Desktop.
Asynchronously trap signals
c = Thread.current
Signal.trap("SIGINT") do
c.wakeup
end
while true
sleep
puts "wake"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment