大致如下
class ListPetHandler(RequestHandler):
def get(self):
pass
class AddPetHandler(RequestHandler):
def get(self):
do_something()
其中的do_something()
应该是在后端跑起一个独立于tornado server存在的Pet
实例,而不是在请求结束之后就消失
PHPz2017-04-18 09:46:57
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?