大致如下
class ListPetHandler(RequestHandler): def get(self): pass class AddPetHandler(RequestHandler): def get(self): do_something()
其中的do_something()应该是在后端跑起一个独立于tornado server存在的Pet实例,而不是在请求结束之后就消失
do_something()
Pet
认证高级PHP讲师
I don’t quite understand what you’re thinking. Why do you want to keep running this instance? Can’t we use redis or the like for content storage?
Use http://www.celeryproject.org/
Isn’t the most common threading method enough to open a thread?
I don’t quite understand what you’re thinking. Why do you want to keep running this instance? Can’t we use redis or the like for content storage?
Use http://www.celeryproject.org/
Isn’t the most common threading method enough to open a thread?