def yield_task(self, fn, *args, **kwargs):

    ioloop = IOLoop.current()
    future = Future()
    def call():
      result = None
      error = None
      try:
        result = fn(*args, **kwargs)
      except Exception as e:
        ioloop.add_callback(future.set_exc_info, exc_info())
      else:
        # tornado future is not threadsafe
        ioloop.add_callback(future.set_result, result)
    self.add_task(call)
    return future
Like add_task but will call the function as a coroutine, allowing you
dataset/ETHPy150Open JeremyOT/Toto/toto/tasks.py/TaskQueue.yield_task