code: def get(self, udid):
          ''' get new task '''
          timeout = self.get_argument('timeout', 20.0)
          if timeout is not None:
              timeout = float(timeout)
          que = self.ques[udid]
          try:
              item = yield que.get(timeout=time.time()+timeout) # timeout is a timestamp, strange
              print 'get from queue:', item
              self.write(item)
              que.task_done()
          except gen.TimeoutError:
              print 'timeout'
              self.write('')
          finally:
              self.finish(f get(self, udid):
          ''' get new task '''
          timeout = self.get_argument('timeout', 20.0)
          if timeout is not None:
              timeout = float(timeout)
          que = self.ques[udid]
          try:
              item = yield que.get(timeout=time.time()+timeout) # timeout is a timestamp, strange
              print 'get from queue:', item
              self.write(item)
              que.task_done()
          except gen.TimeoutError:
              print 'timeout'
              self.write('')
          finally:
              self.finish()
docs: get new task