Tornado 6.5 Documentationfunction: from tornado.httpclient import HTTPClient def synchronous_fetch(url): http_client = HTTPClient() response = http_client.fetch(url) return response.body And here is the same function rewritten asynchronously httpclient import AsyncHTTPClient async def asynchronous_fetch(url): http_client = AsyncHTTPClient() response = await http_client.fetch(url) return response.body Or for compatibility with older versions AsyncHTTPClient from tornado import gen @gen.coroutine def async_fetch_gen(url): http_client = AsyncHTTPClient() response = yield http_client.fetch(url) raise gen.Return(response.body) Coroutines are a little magical0 码力 | 272 页 | 1.12 MB | 3 月前3
Tornado 6.5 Documentationfrom tornado.httpclient import HTTPClient def synchronous_fetch(url): http_client = HTTPClient() response = http_client.fetch(url) return response.body And here is the same function rewritten httpclient import AsyncHTTPClient async def asynchronous_fetch(url): http_client = AsyncHTTPClient() response = await http_client.fetch(url) return response.body Or for compatibility with older tornado import gen @gen.coroutine def async_fetch_gen(url): http_client = AsyncHTTPClient() response = yield http_client.fetch(url) raise gen.Return(response.body) Coroutines are a little0 码力 | 437 页 | 405.14 KB | 3 月前3
julia 1.10.10by package actions which change the manifest. See Pkg.precompile. JULIA_PKG_SERVER Specifies the URL of the package registry to use. By default, Pkg uses https://pkg.julialang.org to fetch Julia packages ExponentialBackOff(n=3, first_delay=5, max_delay=1000)) retry(http_get, check=(s,e)->e.status == "503")(url) retry(read, check=(s,e)->isa(e, IOError))(io, 128; all=false) source Base.ExponentialBackOff – instead. source Base.download – Function. download(url::AbstractString, [path::AbstractString = tempname()]) -> path Download a file from the given url, saving it to the location path, or if not specified0 码力 | 1692 页 | 6.34 MB | 3 月前3
Julia 1.10.9by package actions which change the manifest. See Pkg.precompile. JULIA_PKG_SERVER Specifies the URL of the package registry to use. By default, Pkg uses https://pkg.julialang.org to fetch Julia packages ExponentialBackOff(n=3, first_delay=5, max_delay=1000)) retry(http_get, check=(s,e)->e.status == "503")(url) retry(read, check=(s,e)->isa(e, IOError))(io, 128; all=false) source Base.ExponentialBackOff – instead. source Base.download – Function. download(url::AbstractString, [path::AbstractString = tempname()]) -> path Download a file from the given url, saving it to the location path, or if not specified0 码力 | 1692 页 | 6.34 MB | 3 月前3
Julia 1.11.4by package actions which change the manifest. See Pkg.precompile. JULIA_PKG_SERVER Specifies the URL of the package registry to use. By default, Pkg uses https://pkg.julialang.org to fetch Julia packages ExponentialBackOff(n=3, first_delay=5, max_delay=1000)) retry(http_get, check=(s,e)->e.status == "503")(url) retry(read, check=(s,e)->isa(e, IOError))(io, 128; all=false) source Base.ExponentialBackOff – instead. source Base.download – Function. download(url::AbstractString, [path::AbstractString = tempname()]) -> path Download a file from the given url, saving it to the location path, or if not specified0 码力 | 2007 页 | 6.73 MB | 3 月前3
Julia 1.11.5 Documentationby package actions which change the manifest. See Pkg.precompile. JULIA_PKG_SERVER Specifies the URL of the package registry to use. By default, Pkg uses https://pkg.julialang.org to fetch Julia packages ExponentialBackOff(n=3, first_delay=5, max_delay=1000)) retry(http_get, check=(s,e)->e.status == "503")(url) retry(read, check=(s,e)->isa(e, IOError))(io, 128; all=false) source Base.ExponentialBackOff – instead. source Base.download – Function. download(url::AbstractString, [path::AbstractString = tempname()]) -> path Download a file from the given url, saving it to the location path, or if not specified0 码力 | 2007 页 | 6.73 MB | 3 月前3
Julia 1.11.6 Release Notesby package actions which change the manifest. See Pkg.precompile. JULIA_PKG_SERVER Specifies the URL of the package registry to use. By default, Pkg uses https://pkg.julialang.org to fetch Julia packages ExponentialBackOff(n=3, first_delay=5, max_delay=1000)) retry(http_get, check=(s,e)->e.status == "503")(url) retry(read, check=(s,e)->isa(e, IOError))(io, 128; all=false) source Base.ExponentialBackOff – instead. source Base.download – Function. download(url::AbstractString, [path::AbstractString = tempname()]) -> path Download a file from the given url, saving it to the location path, or if not specified0 码力 | 2007 页 | 6.73 MB | 3 月前3
julia 1.13.0 DEVby package actions which change the manifest. See Pkg.precompile. JULIA_PKG_SERVER Specifies the URL of the package registry to use. By default, Pkg uses https://pkg.julialang.org to fetch Julia packages ExponentialBackOff(n=3, first_delay=5, max_delay=1000)) retry(http_get, check=(s,e)->e.status == "503")(url) retry(read, check=(s,e)->isa(e, IOError))(io, 128; all=false) source Base.ExponentialBackOff – FILESYSTEM 1203 Base.download – Function. download(url::AbstractString, [path::AbstractString = tempname()]) -> path Download a file from the given url, saving it to the location path, or if not specified0 码力 | 2058 页 | 7.45 MB | 3 月前3
Julia 1.12.0 RC1by package actions which change the manifest. See Pkg.precompile. JULIA_PKG_SERVER Specifies the URL of the package registry to use. By default, Pkg uses https://pkg.julialang.org to fetch Julia packages ExponentialBackOff(n=3, first_delay=5, max_delay=1000)) retry(http_get, check=(s,e)->e.status == "503")(url) retry(read, check=(s,e)->isa(e, IOError))(io, 128; all=false) source Base.ExponentialBackOff – FILESYSTEM 1201 Base.download – Function. download(url::AbstractString, [path::AbstractString = tempname()]) -> path Download a file from the given url, saving it to the location path, or if not specified0 码力 | 2057 页 | 7.44 MB | 3 月前3
Julia 1.12.0 Beta4by package actions which change the manifest. See Pkg.precompile. JULIA_PKG_SERVER Specifies the URL of the package registry to use. By default, Pkg uses https://pkg.julialang.org to fetch Julia packages ExponentialBackOff(n=3, first_delay=5, max_delay=1000)) retry(http_get, check=(s,e)->e.status == "503")(url) retry(read, check=(s,e)->isa(e, IOError))(io, 128; all=false) source Base.ExponentialBackOff – FILESYSTEM 1200 Base.download – Function. download(url::AbstractString, [path::AbstractString = tempname()]) -> path Download a file from the given url, saving it to the location path, or if not specified0 码力 | 2057 页 | 7.44 MB | 3 月前3
共 13 条
- 1
- 2













