Tornado 6.1 Documentation
organize your code in the same way you would if it were synchronous. This is especially important for error handling, since try/except blocks work as you would expect in coroutines while this is difficult to parallel_fetch_many(urls): responses = await multi ([http_client.fetch(url) for url in urls]) # responses is a list of HTTPResponses in the same order async def parallel_fetch_dict(urls): responses = await multi({url: multi({url: http_client.fetch(url) for url in urls}) # responses is a dict {url: HTTPResponse} In decorated coroutines, it is possible to yield the list or dict directly: @gen.coroutine def parallel_fetch_decorated(url10 码力 | 245 页 | 904.24 KB | 1 年前3
Tornado 6.0 Documentation
organize your code in the same way you would if it were synchronous. This is especially important for error handling, since try/except blocks work as you would expect in coroutines while this is difficult to parallel_fetch_many(urls): responses = await multi ([http_client.fetch(url) for url in urls]) # responses is a list of HTTPResponses in the same order async def parallel_fetch_dict(urls): responses = await multi({url: multi({url: http_client.fetch(url) for url in urls}) # responses is a dict {url: HTTPResponse} In decorated coroutines, it is possible to yield the list or dict directly: @gen.coroutine def parallel_fetch_decorated(url10 码力 | 245 页 | 885.76 KB | 1 年前3
Tornado 5.1 Documentation
Application object Subclassing RequestHandler Handling request input Overriding RequestHandler methods Error Handling Redirection Asynchronous handlers Templates and UI Configuring templates Template syntax organize your code in the same way you would if it were synchronous. This is especially important for error handling, since try/except blocks work as you would expect in coroutines while this is difficult to urls): responses = await multi ([http_client.fetch(url) for url in urls]) # responses is a list of HTTPResponses in the same order async def parallel_fetch_dict(urls): responses = await multi({url:0 码力 | 359 页 | 347.32 KB | 1 年前3
Tornado 5.1 Documentation
organize your code in the same way you would if it were synchronous. This is especially important for error handling, since try/except blocks work as you would expect in coroutines while this is difficult to parallel_fetch_many(urls): responses = await multi ([http_client.fetch(url) for url in urls]) # responses is a list of HTTPResponses in the same order async def parallel_fetch_dict(urls): responses = await multi({url: multi({url: http_client.fetch(url) for url in urls}) # responses is a dict {url: HTTPResponse} In decorated coroutines, it is possible to yield the list or dict directly: @gen.coroutine def parallel_fetch_decorated(url10 码力 | 243 页 | 895.80 KB | 1 年前3
Tornado 6.5 Documentationorganize your code in the same way you would if it were synchronous. This is especially important for error handling, since try/except blocks work as you would expect in coroutines while this is difficult to parallel_fetch_many(urls): responses = await multi ([http_client.fetch(url) for url in urls]) # responses is a list of HTTPResponses in the same order async def parallel_fetch_dict(urls): responses = await multi({url: multi({url: http_client.fetch(url) for url in urls}) # responses is a dict {url: HTTPResponse} In decorated coroutines, it is possible to yield the list or dict directly: @gen.coroutine def parallel_fetch_decorated(url10 码力 | 272 页 | 1.12 MB | 3 月前3
Tornado 6.4 Documentation
organize your code in the same way you would if it were synchronous. This is especially important for error handling, since try/except blocks work as you would expect in coroutines while this is difficult to parallel_fetch_many(urls): responses = await multi ([http_client.fetch(url) for url in urls]) # responses is a list of HTTPResponses in the same order async def parallel_fetch_dict(urls): responses = await multi({url: multi({url: http_client.fetch(url) for url in urls}) # responses is a dict {url: HTTPResponse} In decorated coroutines, it is possible to yield the list or dict directly: @gen.coroutine def parallel_fetch_decorated(url10 码力 | 268 页 | 1.09 MB | 1 年前3
Tornado 6.4 Documentation
organize your code in the same way you would if it were synchronous. This is especially important for error handling, since try/except blocks work as you would expect in coroutines while this is difficult to parallel_fetch_many(urls): responses = await multi ([http_client.fetch(url) for url in urls]) # responses is a list of HTTPResponses in the same order async def parallel_fetch_dict(urls): responses = await multi({url: multi({url: http_client.fetch(url) for url in urls}) # responses is a dict {url: HTTPResponse} In decorated coroutines, it is possible to yield the list or dict directly: @gen.coroutine def parallel_fetch_decorated(url10 码力 | 268 页 | 1.09 MB | 1 年前3
Tornado 6.4 Documentation
organize your code in the same way you would if it were synchronous. This is especially important for error handling, since try/except blocks work as you would expect in coroutines while this is difficult to parallel_fetch_many(urls): responses = await multi ([http_client.fetch(url) for url in urls]) # responses is a list of HTTPResponses in the same order async def parallel_fetch_dict(urls): responses = await multi({url: multi({url: http_client.fetch(url) for url in urls}) # responses is a dict {url: HTTPResponse} In decorated coroutines, it is possible to yield the list or dict directly: @gen.coroutine def parallel_fetch_decorated(url10 码力 | 268 页 | 1.09 MB | 1 年前3
Tornado 6.2 Documentation
organize your code in the same way you would if it were synchronous. This is especially important for error handling, since try/except blocks work as you would expect in coroutines while this is difficult to parallel_fetch_many(urls): responses = await multi ([http_client.fetch(url) for url in urls]) # responses is a list of HTTPResponses in the same order async def parallel_fetch_dict(urls): responses = await multi({url: multi({url: http_client.fetch(url) for url in urls}) # responses is a dict {url: HTTPResponse} In decorated coroutines, it is possible to yield the list or dict directly: @gen.coroutine def parallel_fetch_decorated(url10 码力 | 260 页 | 1.06 MB | 1 年前3
Tornado 6.3 Documentation
organize your code in the same way you would if it were synchronous. This is especially important for error handling, since try/except blocks work as you would expect in coroutines while this is difficult to parallel_fetch_many(urls): responses = await multi ([http_client.fetch(url) for url in urls]) # responses is a list of HTTPResponses in the same order async def parallel_fetch_dict(urls): responses = await multi({url: multi({url: http_client.fetch(url) for url in urls}) # responses is a dict {url: HTTPResponse} In decorated coroutines, it is possible to yield the list or dict directly: @gen.coroutine def parallel_fetch_decorated(url10 码力 | 264 页 | 1.06 MB | 1 年前3
共 20 条
- 1
- 2













