title: How can I use Tornado and Redis asynchronously?
body: <p>I'm trying to find how can I use Redis and Tornado asynchronously. I found the <a href="https://github.com/leporo/tornado-redis">tornado-redis</a> but I need more than just add a <code>yield</code> in the code.</p>
  
  <p>I have the following code:</p>
  
  <pre><code>import redis
  import tornado.web
  
  class WaiterHandler(tornado.web.RequestHandler):
  
      @tornado.web.asynchronous
      def get(self):
          client = redis.StrictRedis(port=6279)
          pubsub = client.pubsub()
          pubsub.subscribe('test_channel')
  
          for item in pubsub.listen():
              if item['type'] == 'message':
                  print item['channel']
                  print item['data']
  
          self.write(item['data'])
          self.finish()
  
  
  class GetHandler(tornado.web.RequestHandler):
  
      def get(self):
          self.write("Hello world")
  
  
  application = tornado.web.Application([
      (r"/", GetHandler),
      (r"/wait", WaiterHandler),
  ])
  
  if __name__ == '__main__':
      application.listen(8888)
      print 'running'
      tornado.ioloop.IOLoop.instance().start()
  </code></pre>
  
  <p>I need getting access the <code>/</code> url and get the "Hello World" while there's a request pending in the <code>/wait</code>.
  How can I do it?</p>