Tornado 6.5 DocumentationApplication([ (r"/", MainHandler), ]) async def main(): app = make_app() app.listen(8888) await asyncio.Event().wait() if __name__ == "__main__": asyncio.run(main()) This example does not use any of Tornado’s INTEGRATION Tornado is integrated with the standard library asyncio module and shares the same event loop (by default since Tornado 5.0). In general, libraries designed for use with asyncio can be mixed very expensive. To minimize the cost of concurrent connections, Tornado uses a single-threaded event loop. This means that all appli- cation code should aim to be asynchronous and non-blocking because0 码力 | 272 页 | 1.12 MB | 3 月前3
Tornado 6.4 Documentation
Application([ (r"/", MainHandler), ]) async def main(): app = make_app() app.listen(8888) await asyncio.Event().wait() if __name__ == "__main__": asyncio.run(main()) This example does not use any of Tornado’s INTEGRATION Tornado is integrated with the standard library asyncio module and shares the same event loop (by default since Tornado 5.0). In general, libraries designed for use with asyncio can be mixed very expensive. To minimize the cost of concurrent connections, Tornado uses a single-threaded event loop. This means that all appli- cation code should aim to be asynchronous and non-blocking because0 码力 | 268 页 | 1.09 MB | 1 年前3
Tornado 6.4 Documentation
Application([ (r"/", MainHandler), ]) async def main(): app = make_app() app.listen(8888) await asyncio.Event().wait() if __name__ == "__main__": asyncio.run(main()) This example does not use any of Tornado’s INTEGRATION Tornado is integrated with the standard library asyncio module and shares the same event loop (by default since Tornado 5.0). In general, libraries designed for use with asyncio can be mixed very expensive. To minimize the cost of concurrent connections, Tornado uses a single-threaded event loop. This means that all appli- cation code should aim to be asynchronous and non-blocking because0 码力 | 268 页 | 1.09 MB | 1 年前3
Tornado 6.4 Documentation
Application([ (r"/", MainHandler), ]) async def main(): app = make_app() app.listen(8888) await asyncio.Event().wait() if __name__ == "__main__": asyncio.run(main()) This example does not use any of Tornado’s INTEGRATION Tornado is integrated with the standard library asyncio module and shares the same event loop (by default since Tornado 5.0). In general, libraries designed for use with asyncio can be mixed very expensive. To minimize the cost of concurrent connections, Tornado uses a single-threaded event loop. This means that all appli- cation code should aim to be asynchronous and non-blocking because0 码力 | 268 页 | 1.09 MB | 1 年前3
Tornado 6.3 Documentation
Application([ (r"/", MainHandler), ]) async def main(): app = make_app() app.listen(8888) await asyncio.Event().wait() if __name__ == "__main__": asyncio.run(main()) This example does not use any of Tornado’s INTEGRATION Tornado is integrated with the standard library asyncio module and shares the same event loop (by default since Tornado 5.0). In general, libraries designed for use with asyncio can be mixed very expensive. To minimize the cost of concurrent connections, Tornado uses a single-threaded event loop. This means that all appli- cation code should aim to be asynchronous and non-blocking because0 码力 | 264 页 | 1.06 MB | 1 年前3
Tornado 6.2 Documentation
Application([ (r"/", MainHandler), ]) async def main(): app = make_app() app.listen(8888) await asyncio.Event().wait() if __name__ == "__main__": asyncio.run(main()) This example does not use any of Tornado’s INTEGRATION Tornado is integrated with the standard library asyncio module and shares the same event loop (by default since Tornado 5.0). In general, libraries designed for use with asyncio can be mixed very expensive. To minimize the cost of concurrent connections, Tornado uses a single-threaded event loop. This means that all appli- cation code should aim to be asynchronous and non-blocking because0 码力 | 260 页 | 1.06 MB | 1 年前3
websockets Documentation
Release 5.0async with websockets.connect(uri) as websocket: await websocket.send("Hello world!") asyncio.get_event_loop().run_until_complete( hello('ws://localhost:8765')) And here’s an echo server: #!/usr/bin/env websocket: await websocket.send(message) asyncio.get_event_loop().run_until_complete( websockets.serve(echo, 'localhost', 8765)) asyncio.get_event_loop().run_forever() Do you like it? Let’s dive in! Contents start_server = websockets.serve(hello, 'localhost', 8765) asyncio.get_event_loop().run_until_complete(start_server) asyncio.get_event_loop().run_forever() On the server side, websockets executes the handler0 码力 | 56 页 | 245.43 KB | 1 年前3
websockets Documentation
Release 6.0async with websockets.connect(uri) as websocket: await websocket.send("Hello world!") asyncio.get_event_loop().run_until_complete( hello('ws://localhost:8765')) And here’s an echo server: #!/usr/bin/env websocket: await websocket.send(message) asyncio.get_event_loop().run_until_complete( websockets.serve(echo, 'localhost', 8765)) asyncio.get_event_loop().run_forever() Do you like it? Let’s dive in! Contents start_server = websockets.serve(hello, 'localhost', 8765) asyncio.get_event_loop().run_until_complete(start_server) asyncio.get_event_loop().run_forever() On the server side, websockets executes the handler0 码力 | 58 页 | 253.08 KB | 1 年前3
Tornado 6.1 Documentation
Integration Tornado is integrated with the standard library asyncio module and shares the same event loop (by default since Tornado 5.0). In general, libraries designed for use with asyncio can be mixed very expensive. To minimize the cost of concurrent connections, Tornado uses a single-threaded event loop. This means that all application code should aim to be asynchronous and non-blocking because only Documentation, Release 6.1 Here is a simplified version of the coroutine decorator’s inner loop: # Simplified inner loop of tornado.gen.Runner def run(self): # send(x) makes the current yield return x. # It0 码力 | 245 页 | 904.24 KB | 1 年前3
websockets Documentation
Release 9.0connect(uri) as websocket: await websocket.send("Hello world!") await websocket.recv() asyncio.get_event_loop().run_until_complete(hello()) And here’s an echo server: #!/usr/bin/env python import asyncio start_server = websockets.serve(echo, "localhost", 8765) asyncio.get_event_loop().run_until_complete(start_server) asyncio.get_event_loop().run_forever() Do you like it? Let’s dive in! CONTENTS 1 websockets start_server = websockets.serve(hello, "localhost", 8765) asyncio.get_event_loop().run_until_complete(start_server) asyncio.get_event_loop().run_forever() On the server side, websockets executes the handler0 码力 | 81 页 | 352.88 KB | 1 年前3
共 1000 条
- 1
- 2
- 3
- 4
- 5
- 6
- 100













