Tornado 5.1 Documentation
CHAPTER 2 Hello, world Here is a simple “Hello, world” example web app for Tornado: import tornado.ioloop import tornado.web class MainHandler(tornado.web.RequestHandler): def get(self): self.write("Hello (r"/", MainHandler), ]) if __name__ == "__main__": app = make_app() app.listen(8888) tornado.ioloop.IOLoop.current().start() This example does not use any of Tornado’s asynchronous features; for that thread-safe. The only method in Tornado that is safe to call from other threads is IOLoop.add_callback. You can also use IOLoop.run_in_executor to asynchronously run a blocking function on another thread, but0 码力 | 243 页 | 895.80 KB | 1 年前3
Tornado 6.0 Documentation
TWO HELLO, WORLD Here is a simple “Hello, world” example web app for Tornado: import tornado.ioloop import tornado.web class MainHandler(tornado.web.RequestHandler): def get(self): self.write("Hello (r"/", MainHandler), ]) if __name__ == "__main__": app = make_app() app.listen(8888) tornado.ioloop.IOLoop.current().start() This example does not use any of Tornado’s asynchronous features; for that thread-safe. The only method in Tornado that is safe to call from other threads is IOLoop.add_callback. You can also use IOLoop.run_in_executor to asynchronously run a blocking function on another thread, but0 码力 | 245 页 | 885.76 KB | 1 年前3
Tornado 6.1 Documentation
CHAPTER 2 Hello, world Here is a simple “Hello, world” example web app for Tornado: import tornado.ioloop import tornado.web class MainHandler(tornado.web.RequestHandler): def get(self): self.write("Hello (r"/", MainHandler), ]) if __name__ == "__main__": app = make_app() app.listen(8888) tornado.ioloop.IOLoop.current().start() This example does not use any of Tornado’s asynchronous features; for that thread-safe. The only method in Tornado that is safe to call from other threads is IOLoop.add_callback. You can also use IOLoop.run_in_executor to asynchronously run a blocking function on another thread, but0 码力 | 245 页 | 904.24 KB | 1 年前3
Tornado 5.1 Documentation
nks] Hello, world Here is a simple “Hello, world” example web app for Tornado: import tornado.ioloop import tornado.web class MainHandler(tornado.web.RequestHandler): def get(self): self MainHandler), ]) if __name__ == "__main__": app = make_app() app.listen(8888) tornado.ioloop.IOLoop.current().start() This example does not use any of Tornado’s asynchronous features; for that thread-safe. The only method in Tornado that is safe to call from other threads is IOLoop.add_callback. You can also use IOLoop.run_in_executor to asynchronously run a blocking function on another thread, but0 码力 | 359 页 | 347.32 KB | 1 年前3
Tornado 4.5 Documentation
nks] Hello, world Here is a simple “Hello, world” example web app for Tornado: import tornado.ioloop import tornado.web class MainHandler(tornado.web.RequestHandler): def get(self): self MainHandler), ]) if __name__ == "__main__": app = make_app() app.listen(8888) tornado.ioloop.IOLoop.current().start() This example does not use any of Tornado’s asynchronous features; for that recommended only for development use. Without reworking Tornado IOLoop interface, it’s not possible to add a native Tornado Windows IOLoop implementation or leverage Windows’ IOCP support from frameworks0 码力 | 333 页 | 322.34 KB | 1 年前3
Tornado 4.5 Documentation
CHAPTER 2 Hello, world Here is a simple “Hello, world” example web app for Tornado: import tornado.ioloop import tornado.web class MainHandler(tornado.web.RequestHandler): def get(self): self.write("Hello (r"/", MainHandler), ]) if __name__ == "__main__": app = make_app() app.listen(8888) tornado.ioloop.IOLoop.current().start() This example does not use any of Tornado’s asynchronous features; for that recommended only for development use. Without reworking Tornado IOLoop interface, it’s not possible to add a native Tornado Windows IOLoop implementation or leverage Windows’ IOCP support from frameworks0 码力 | 222 页 | 833.04 KB | 1 年前3
Tornado 6.5 Documentationthread-safe. The only method in Tornado that is safe to call from other threads is IOLoop.add_callback. You can also use IOLoop.run_in_executor to asynchronously run a blocking function on another thread, but HTTP (HTTPServer and AsyncHTTPClient). • An asynchronous networking library including the classes IOLoop and IOStream, which serve as the building blocks for the HTTP components and can also be used to generally return placeholder objects (Futures), with the exception of some low- level components like the IOLoop that use callbacks. Futures are usually transformed into their result with the await or yield keywords0 码力 | 272 页 | 1.12 MB | 3 月前3
Tornado 6.4 Documentation
thread-safe. The only method in Tornado that is safe to call from other threads is IOLoop.add_callback. You can also use IOLoop.run_in_executor to asynchronously run a blocking function on another thread, but HTTP (HTTPServer and AsyncHTTPClient). • An asynchronous networking library including the classes IOLoop and IOStream, which serve as the building blocks for the HTTP components and can also be used to generally return placeholder objects (Futures), with the exception of some low- level components like the IOLoop that use callbacks. Futures are usually transformed into their result with the await or yield keywords0 码力 | 268 页 | 1.09 MB | 1 年前3
Tornado 6.4 Documentation
thread-safe. The only method in Tornado that is safe to call from other threads is IOLoop.add_callback. You can also use IOLoop.run_in_executor to asynchronously run a blocking function on another thread, but HTTP (HTTPServer and AsyncHTTPClient). • An asynchronous networking library including the classes IOLoop and IOStream, which serve as the building blocks for the HTTP components and can also be used to generally return placeholder objects (Futures), with the exception of some low- level components like the IOLoop that use callbacks. Futures are usually transformed into their result with the await or yield keywords0 码力 | 268 页 | 1.09 MB | 1 年前3
Tornado 6.4 Documentation
thread-safe. The only method in Tornado that is safe to call from other threads is IOLoop.add_callback. You can also use IOLoop.run_in_executor to asynchronously run a blocking function on another thread, but HTTP (HTTPServer and AsyncHTTPClient). • An asynchronous networking library including the classes IOLoop and IOStream, which serve as the building blocks for the HTTP components and can also be used to generally return placeholder objects (Futures), with the exception of some low- level components like the IOLoop that use callbacks. Futures are usually transformed into their result with the await or yield keywords0 码力 | 268 页 | 1.09 MB | 1 年前3
共 188 条
- 1
- 2
- 3
- 4
- 5
- 6
- 19













