Does initialize in tornado.web.RequestHandler get called every time for a request/

Deadly 提交于 2019-12-05 05:43:33

问题


There'a an initialize method in tornado.web.RequestHandler class, is it called every time there's a request?


回答1:


Yes, tornado calls initialize for each request.

If you want to share state between requests(like db connection) - store it in self.application.



来源:https://stackoverflow.com/questions/15199028/does-initialize-in-tornado-web-requesthandler-get-called-every-time-for-a-reques

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!