From: Peter Nelson Date: Tue, 14 Aug 2018 23:29:30 +0000 (-0500) Subject: Use spawn_callback method to handle connection X-Git-Tag: v5.1.1~1^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fb83cf5e87a231f490d2bda492e6c72023945ca0;p=thirdparty%2Ftornado.git Use spawn_callback method to handle connection --- diff --git a/tornado/ioloop.py b/tornado/ioloop.py index 8e89c2e35..889153af7 100644 --- a/tornado/ioloop.py +++ b/tornado/ioloop.py @@ -101,7 +101,6 @@ class IOLoop(Configurable): import socket import tornado.ioloop - from tornado.gen import convert_yielded from tornado.iostream import IOStream async def handle_connection(connection, address): @@ -118,8 +117,8 @@ class IOLoop(Configurable): raise return connection.setblocking(0) - coro = handle_connection(connection, address) - convert_yielded(coro) + io_loop = tornado.ioloop.IOLoop.current() + io_loop.spawn_callback(handle_connection, connection, address) if __name__ == '__main__': sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM, 0)