title: Infinite "background" loop for Tornado WebSockets handler
body: <p>I am trying to create a WebSocket server using Tornado. What I would like to do is execute a specific command, that will dispatch a message for every cycle of the IOLoop.</p>
  
  <p>To make it more clear; let's say I have the following WebSocket handler</p>
  
  <pre><code>class MyHandler(websocket.WebSocketHandler):
  
  def auto_loop(self, *args, **kwargs):
      self.write_message('automatic message')
  </code></pre>
  
  <p>Is there any way to run <code>auto_loop</code> on every IOLoop cycle, without blocking the main thread?</p>
  
  <p>I suppose that I can use greenlets for that, but I am searching for a more Tornado-native solution.</p>
  
  <p>Thank you</p>