4
class AsyncHandler(tornado.web.RequestHandler):
@tornado.web.asynchronous
def get(self):
tasks.sleep.apply_async(args=[5], callback=self.on_result)
def on_result(self, response):
self.write(str(response.result))
self.finish()
引發錯誤:龍捲風芹菜不能使用gen.Task或回調
raise TypeError(repr(o) + " is not JSON serializable")
TypeError: <bound method AsyncHandler.on_result
of <__main__.AsyncHandler object at 0x10e7a19d0>> is not JSON serializable
經紀人和後端都使用Redis的,我剛從 https://github.com/mher/tornado-celery
複製當我使用AMQP代理和redis後端它運作良好,但不是在使用redis broker時。這是因爲龍捲風異步不支持redis broker嗎?
當我使用amqp代理和redis後端它運作良好,因爲龍捲風async不支持redis borker? – 2015-03-02 12:10:32