From 5949aad713289f0fcc8c3c61f7e8c5753af62621 Mon Sep 17 00:00:00 2001 From: luojiebin Date: Sat, 16 Dec 2017 01:10:32 +0800 Subject: [PATCH] Return a Future from finish method of RequestHandler --- tornado/web.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tornado/web.py b/tornado/web.py index f970bd130..3ce507f3d 100644 --- a/tornado/web.py +++ b/tornado/web.py @@ -1025,12 +1025,13 @@ class RequestHandler(object): # are keepalive connections) self.request.connection.set_close_callback(None) - self.flush(include_footers=True) + future = self.flush(include_footers=True) self.request.connection.finish() self._log() self._finished = True self.on_finish() self._break_cycles() + return future def detach(self): """Take control of the underlying stream. -- 2.47.3