]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
Use spawn_callback method to handle connection
authorPeter Nelson <peter@peterdn.com>
Tue, 14 Aug 2018 23:29:30 +0000 (18:29 -0500)
committerBen Darnell <ben@bendarnell.com>
Sun, 16 Sep 2018 17:48:53 +0000 (13:48 -0400)
tornado/ioloop.py

index 8e89c2e35b6c7df1ffdcc522c08c874b83b0d618..889153af7797d51fdd89b91d48ac55ee030dc593 100644 (file)
@@ -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)