Skip to content

Instantly share code, notes, and snippets.

@halorgium
Created May 31, 2013 07:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save halorgium/4980a737728b7ea22ece to your computer and use it in GitHub Desktop.
Save halorgium/4980a737728b7ea22ece to your computer and use it in GitHub Desktop.
Trapping signals in Celluloid
r, w = IO.pipe
Thread.new {
while r.read(1)
$stderr.puts "got a SIGUSR1"
end
}
trap("INT") {
w.write(".")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment