処理に時間がかかる統計データを収集したいのですが、返されるユーザーコンテンツには影響しません。私は現在、最初にキャッシュし、次にcronジョブで処理することでそれを行っています。
ユーザーコンテンツを返した直後にこの仕事をする方法はありますか?
次のようになります。
def post(self):
self.response.out.write("some output")
# here user should not wait any more output
# loading should be end in user browser.
collectSomeStatistics(self)
(私はPython 2.7を使用しています)