]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
httpclient: Update docs
authorBen Darnell <ben@bendarnell.com>
Sun, 30 Dec 2018 17:42:42 +0000 (12:42 -0500)
committerBen Darnell <ben@bendarnell.com>
Sun, 30 Dec 2018 20:14:36 +0000 (15:14 -0500)
docs/conf.py
docs/httpclient.rst
tornado/httpclient.py
tornado/test/twisted_test.py

index 04668eaf0e4e84c2e3c13512f53d84cf218b1f15..f0cfa9c292a19969ab1de8a30cc01a44a5d87361 100644 (file)
@@ -38,6 +38,7 @@ coverage_ignore_modules = [
     "tornado.platform.asyncio",
     "tornado.platform.caresresolver",
     "tornado.platform.twisted",
+    "tornado.simple_httpclient",
 ]
 # I wish this could go in a per-module file...
 coverage_ignore_classes = [
index cf3bc8e715d1c8511cb0c77379b51e28d43181f0..178dc1480a662903552e4a473718c5df636cd180 100644 (file)
@@ -47,7 +47,9 @@ Implementations
 ~~~~~~~~~~~~~~~
 
 .. automodule:: tornado.simple_httpclient
-   :members:
+   
+   .. autoclass:: SimpleAsyncHTTPClient
+      :members:
 
 .. module:: tornado.curl_httpclient
 
index 8606c01e60b9cdbb1d2b7ff1beaa3cde9113b18d..e02c60e3d6f9591b4c5baf811f2663767fefdde7 100644 (file)
@@ -20,8 +20,6 @@ to switch to ``curl_httpclient`` for reasons such as the following:
 
 * ``curl_httpclient`` is faster.
 
-* ``curl_httpclient`` was the default prior to Tornado 2.0.
-
 Note that if you are using ``curl_httpclient``, it is highly
 recommended that you use a recent version of ``libcurl`` and
 ``pycurl``.  Currently the minimum supported version of libcurl is
@@ -55,7 +53,7 @@ from tornado import gen, httputil
 from tornado.ioloop import IOLoop
 from tornado.util import Configurable
 
-from typing import Type, Any, Union, Dict, Callable, Optional, cast
+from typing import Type, Any, Union, Dict, Callable, Optional, cast, Awaitable
 
 
 class HTTPClient(object):
@@ -251,7 +249,7 @@ class AsyncHTTPClient(Configurable):
         request: Union[str, "HTTPRequest"],
         raise_error: bool = True,
         **kwargs: Any
-    ) -> "Future[HTTPResponse]":
+    ) -> Awaitable["HTTPResponse"]:
         """Executes a request, asynchronously returning an `HTTPResponse`.
 
         The request may be either a string URL or an `HTTPRequest` object.
index 06c49e3b4deacda848e926fe10eb140026871065..0e03cec9f43cc7658555ea30571f40b55b21bf38 100644 (file)
 # License for the specific language governing permissions and limitations
 # under the License.
 
-"""
-Unittest for the twisted-style reactor.
-"""
-
+import asyncio
 import logging
 import signal
 import unittest
@@ -120,7 +117,7 @@ class CompatibilityTests(unittest.TestCase):
 
     def tornado_fetch(self, url, runner):
         client = AsyncHTTPClient()
-        fut = client.fetch(url)
+        fut = asyncio.ensure_future(client.fetch(url))
         fut.add_done_callback(lambda f: self.stop_loop())
         runner()
         return fut.result()