Tornado 6.1 Documentation
result with the 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 a native coroutine: 14 Chapter 6. Documentation Tornado Documentation, Release 6.1 from tornado.httpclient import AsyncHTTPClient async def asynchronous_fetch(url): http_client = AsyncHTTPClient() body Or for compatibility with older versions of Python, using the tornado.gen module: from tornado.httpclient import AsyncHTTPClient from tornado import gen @gen.coroutine def async_fetch_gen(url): http_client0 码力 | 245 页 | 904.24 KB | 1 年前3Tornado 6.4 Documentation
result with the 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 response.body And here is the same function rewritten asynchronously as a native coroutine: from tornado.httpclient import AsyncHTTPClient async def asynchronous_fetch(url): http_client = AsyncHTTPClient() tornado.gen module: 14 Chapter 6. Documentation Tornado Documentation, Release 6.4 from tornado.httpclient import AsyncHTTPClient from tornado import gen @gen.coroutine def async_fetch_gen(url): http_client0 码力 | 268 页 | 1.09 MB | 1 年前3Tornado 6.2 Documentation
result with the 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 response.body And here is the same function rewritten asynchronously as a native coroutine: from tornado.httpclient import AsyncHTTPClient async def asynchronous_fetch(url): http_client = AsyncHTTPClient() tornado.gen module: 14 Chapter 6. Documentation Tornado Documentation, Release 6.2 from tornado.httpclient import AsyncHTTPClient from tornado import gen @gen.coroutine def async_fetch_gen(url): http_client0 码力 | 260 页 | 1.06 MB | 1 年前3Tornado 6.4 Documentation
result with the 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 response.body And here is the same function rewritten asynchronously as a native coroutine: from tornado.httpclient import AsyncHTTPClient async def asynchronous_fetch(url): http_client = AsyncHTTPClient() tornado.gen module: 14 Chapter 6. Documentation Tornado Documentation, Release 6.4 from tornado.httpclient import AsyncHTTPClient from tornado import gen @gen.coroutine def async_fetch_gen(url): http_client0 码力 | 268 页 | 1.09 MB | 1 年前3Tornado 6.4 Documentation
result with the 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 response.body And here is the same function rewritten asynchronously as a native coroutine: from tornado.httpclient import AsyncHTTPClient async def asynchronous_fetch(url): http_client = AsyncHTTPClient() tornado.gen module: 14 Chapter 6. Documentation Tornado Documentation, Release 6.4 from tornado.httpclient import AsyncHTTPClient from tornado import gen @gen.coroutine def async_fetch_gen(url): http_client0 码力 | 268 页 | 1.09 MB | 1 年前3Tornado 6.3 Documentation
result with the 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 response.body And here is the same function rewritten asynchronously as a native coroutine: from tornado.httpclient import AsyncHTTPClient async def asynchronous_fetch(url): http_client = AsyncHTTPClient() tornado.gen module: 14 Chapter 6. Documentation Tornado Documentation, Release 6.3.3 from tornado.httpclient import AsyncHTTPClient from tornado import gen @gen.coroutine def async_fetch_gen(url): http_client0 码力 | 264 页 | 1.06 MB | 1 年前3Tornado 6.5 Documentation
result with the 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 response.body And here is the same function rewritten asynchronously as a native coroutine: from tornado.httpclient import AsyncHTTPClient async def asynchronous_fetch(url): http_client = AsyncHTTPClient() tornado.gen module: 14 Chapter 6. DocumentationTornado Documentation, Release 6.5.1 from tornado.httpclient import AsyncHTTPClient from tornado import gen @gen.coroutine def async_fetch_gen(url): http_client0 码力 | 272 页 | 1.12 MB | 2 月前3Tornado 6.0 Documentation
result with the 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 response.body And here is the same function rewritten asynchronously as a native coroutine: from tornado.httpclient import AsyncHTTPClient async def asynchronous_fetch(url): http_client = AsyncHTTPClient() tornado.gen module: 14 Chapter 6. Documentation Tornado Documentation, Release 6.0.4 from tornado.httpclient import AsyncHTTPClient from tornado import gen @gen.coroutine def async_fetch_gen(url): http_client0 码力 | 245 页 | 885.76 KB | 1 年前3Tornado 4.5 Documentation
communication to the browser HTTP servers and clients tornado.httpserver — Non-blocking HTTP server tornado.httpclient — Asynchronous HTTP client tornado.httputil — Manipulate HTTP headers and URLs tornado.http1connection access). A function can be blocking in some respects and non-blocking in others. For example, tornado.httpclient in the default configuration blocks on DNS resolution but not on other network access (to mitigate actually make things asynchronous). Examples Here is a sample synchronous function: from tornado.httpclient import HTTPClient def synchronous_fetch(url): http_client = HTTPClient() response =0 码力 | 333 页 | 322.34 KB | 1 年前3Tornado 5.1 Documentation
result with the 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 native coroutine: 12 Chapter 5. Documentation Tornado Documentation, Release 5.1.1 from tornado.httpclient import AsyncHTTPClient async def asynchronous_fetch(url): http_client = AsyncHTTPClient() body Or for compatibility with older versions of Python, using the tornado.gen module: from tornado.httpclient import AsyncHTTPClient from tornado import gen @gen.coroutine def async_fetch_gen(url): http_client0 码力 | 243 页 | 895.80 KB | 1 年前3
共 20 条
- 1
- 2