title: pyzmq Tornado ioloop: how to handle KeyboardInterrupt gracefully?
body: <p>I can catch a KeyboardInterrupt in my pyzmq eventloop:</p>
  
  <pre><code>try:
      ioloop.IOLoop.instance().start()
  except KeyboardInterrupt:
      pass
  </code></pre>
  
  <p>But that just stops the ioloop abruptly. I'd like to detect KeyboardInterrupt and shutdown the ioloop manually after a cleanup. How can I do this?</p>