In a tornado request handler if I have to call function foo() which doesn't affect what's returned to the user, it makes sense to return result to the user first and then call foo(). Is it possible to do this easily in tornado (or with some third-party package)?
It's extremely easy:
class Handler(tornado.web.RequestHandler):
def get(self):
self.write('response')
self.finish() # Connection is now closed
foo()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With