Tornado 6.0 Documentation
i/Links] 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): await or yield keywords. Examples Here is a sample synchronous function: from tornado.httpclient import HTTPClient def synchronous_fetch(url): http_client = HTTPClient() response = http_client here is the same function rewritten asynchronously as a native coroutine: from tornado.httpclient import AsyncHTTPClient async def asynchronous_fetch(url): http_client = AsyncHTTPClient() response0 码力 | 869 页 | 692.83 KB | 1 年前3Tornado 6.1 Documentation
i/Links] 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): await or yield keywords. Examples Here is a sample synchronous function: from tornado.httpclient import HTTPClient def synchronous_fetch(url): http_client = HTTPClient() response = http_client here is the same function rewritten asynchronously as a native coroutine: from tornado.httpclient import AsyncHTTPClient async def asynchronous_fetch(url): http_client = AsyncHTTPClient() response0 码力 | 931 页 | 708.03 KB | 1 年前3Tornado 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 await or yield keywords. Examples Here is a sample synchronous function: from tornado.httpclient import HTTPClient def synchronous_fetch(url): http_client = HTTPClient() response = http_client.fetch(url) coroutine: 12 Chapter 5. Documentation Tornado Documentation, Release 5.1.1 from tornado.httpclient import AsyncHTTPClient async def asynchronous_fetch(url): http_client = AsyncHTTPClient() response = await0 码力 | 243 页 | 895.80 KB | 1 年前3Tornado 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 things asynchronous). Examples Here is a sample synchronous function: from tornado.httpclient import HTTPClient def synchronous_fetch(url): http_client = HTTPClient() response = http_client.fetch(url) the same function rewritten to be asynchronous with a callback argument: from tornado.httpclient import AsyncHTTPClient def asynchronous_fetch(url, callback): http_client = AsyncHTTPClient() 10 Chapter0 码力 | 222 页 | 833.04 KB | 1 年前3Tornado 4.5 Documentation
i/Links] 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): things asynchronous). Examples Here is a sample synchronous function: from tornado.httpclient import HTTPClient def synchronous_fetch(url): http_client = HTTPClient() response = http_client the same function rewritten to be asynchronous with a callback argument: from tornado.httpclient import AsyncHTTPClient def asynchronous_fetch(url, callback): http_client = AsyncHTTPClient() def0 码力 | 333 页 | 322.34 KB | 1 年前3Tornado 5.1 Documentation
i/Links] 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): await or yield keywords. Examples Here is a sample synchronous function: from tornado.httpclient import HTTPClient def synchronous_fetch(url): http_client = HTTPClient() response = http_client here is the same function rewritten asynchronously as a native coroutine: from tornado.httpclient import AsyncHTTPClient async def asynchronous_fetch(url): http_client = AsyncHTTPClient() response0 码力 | 359 页 | 347.32 KB | 1 年前3Tornado 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 await or yield keywords. Examples Here is a sample synchronous function: from tornado.httpclient import HTTPClient def synchronous_fetch(url): http_client = HTTPClient() response = http_client.fetch(url) coroutine: 14 Chapter 6. Documentation Tornado Documentation, Release 6.1 from tornado.httpclient import AsyncHTTPClient async def asynchronous_fetch(url): http_client = AsyncHTTPClient() response = await0 码力 | 245 页 | 904.24 KB | 1 年前3Tornado 6.0 Documentation
CHAPTER 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 await or yield keywords. Examples Here is a sample synchronous function: from tornado.httpclient import HTTPClient def synchronous_fetch(url): http_client = HTTPClient() response = http_client.fetch(url) here is the same function rewritten asynchronously as a native coroutine: from tornado.httpclient import AsyncHTTPClient async def asynchronous_fetch(url): http_client = AsyncHTTPClient() response = await0 码力 | 245 页 | 885.76 KB | 1 年前3Tornado 6.5 Documentation
linksCHAPTER TWO HELLO, WORLD Here is a simple “Hello, world” example web app for Tornado: import asyncio import tornado class MainHandler(tornado.web.RequestHandler): def get(self): self.write("Hello await or yield keywords. Examples Here is a sample synchronous function: from tornado.httpclient import HTTPClient def synchronous_fetch(url): http_client = HTTPClient() response = http_client.fetch(url) here is the same function rewritten asynchronously as a native coroutine: from tornado.httpclient import AsyncHTTPClient async def asynchronous_fetch(url): http_client = AsyncHTTPClient() response = await0 码力 | 272 页 | 1.12 MB | 2 月前3Tornado 6.4 Documentation
CHAPTER TWO HELLO, WORLD Here is a simple “Hello, world” example web app for Tornado: import asyncio import tornado class MainHandler(tornado.web.RequestHandler): def get(self): self.write("Hello await or yield keywords. Examples Here is a sample synchronous function: from tornado.httpclient import HTTPClient def synchronous_fetch(url): http_client = HTTPClient() response = http_client.fetch(url) here is the same function rewritten asynchronously as a native coroutine: from tornado.httpclient import AsyncHTTPClient async def asynchronous_fetch(url): http_client = AsyncHTTPClient() response = await0 码力 | 268 页 | 1.09 MB | 1 年前3
共 20 条
- 1
- 2