Tornado celery integration hacks

后端 未结 4 1663
逝去的感伤
逝去的感伤 2020-12-08 05:44

Since nobody provided a solution to this post plus the fact that I desperately need a workaround, here is my situation and some abstract solutions/ideas for debate.

4条回答
  •  鱼传尺愫
    2020-12-08 06:11

    Now, https://github.com/mher/tornado-celery comes to rescue...

    class GenAsyncHandler(web.RequestHandler):
        @asynchronous
        @gen.coroutine
        def get(self):
            response = yield gen.Task(tasks.sleep.apply_async, args=[3])
            self.write(str(response.result))
            self.finish()
    

提交回复
热议问题