From: Ben Darnell Date: Sun, 19 Apr 2015 16:37:43 +0000 (-0400) Subject: More doc updates. X-Git-Tag: v4.2.0b1~14 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5600fde88d036ac9e9ad1d20d74297bbaa75ba7c;p=thirdparty%2Ftornado.git More doc updates. --- diff --git a/docs/conf.py b/docs/conf.py index a37a70d8c..368e4e85c 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -43,7 +43,6 @@ coverage_ignore_classes = [ "TracebackFuture", # tornado.gen - "Multi", "Runner", # tornado.ioloop @@ -71,9 +70,6 @@ coverage_ignore_functions = [ # parse_qs_bytes should probably be documented but it's complicated by # having different implementations between py2 and py3. "parse_qs_bytes", - - # tornado.gen - "multi_future", ] html_favicon = 'favicon.ico' diff --git a/docs/httpclient.rst b/docs/httpclient.rst index 4fde7b502..a641fa293 100644 --- a/docs/httpclient.rst +++ b/docs/httpclient.rst @@ -38,3 +38,15 @@ # Just print the headers python -m tornado.httpclient --print_headers --print_body=false http://www.google.com + +Implementations +~~~~~~~~~~~~~~~ + +.. automodule:: tornado.simple_httpclient + :members: + +.. module:: tornado.curl_httpclient + +.. class:: CurlAsyncHTTPClient(io_loop, max_clients=10, defaults=None) + + ``libcurl``-based HTTP client. diff --git a/docs/process.rst b/docs/process.rst index c9ce63b81..464469fac 100644 --- a/docs/process.rst +++ b/docs/process.rst @@ -3,3 +3,7 @@ .. automodule:: tornado.process :members: + + .. exception:: CalledProcessError + + An alias for `subprocess.CalledProcessError`. diff --git a/docs/releases/next.rst b/docs/releases/next.rst index 9b41deb45..9fb349495 100644 --- a/docs/releases/next.rst +++ b/docs/releases/next.rst @@ -107,8 +107,8 @@ Then the Tornado equivalent is:: * `.run_on_executor` now accepts arguments to control which attributes it uses to find the `.IOLoop` and executor. -``tornado.curl_httpclient`` -~~~~~~~~~~~~~~~~~~~~~~~~~~~ +`tornado.curl_httpclient` +~~~~~~~~~~~~~~~~~~~~~~~~~ * Fixed a bug that would cause the client to stop processing requests if an exception occurred in certain places while there is a queue. @@ -186,8 +186,8 @@ Then the Tornado equivalent is:: * New method `.Subprocess.wait_for_exit` is a coroutine-friendly version of `.Subprocess.set_exit_callback`. -``tornado.simple_httpclient`` -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +`tornado.simple_httpclient` +~~~~~~~~~~~~~~~~~~~~~~~~~~~ * Improved performance on Python 3 by reusing a single `ssl.SSLContext`. * New constructor argument ``max_body_size`` controls the maximum response diff --git a/tornado/httpserver.py b/tornado/httpserver.py index 6062b7936..2dd04dd7a 100644 --- a/tornado/httpserver.py +++ b/tornado/httpserver.py @@ -121,6 +121,9 @@ class HTTPServer(TCPServer, Configurable, `.HTTPServerConnectionDelegate.start_request` is now called with two arguments ``(server_conn, request_conn)`` (in accordance with the documentation) instead of one ``(request_conn)``. + + .. versionchanged:: 4.2 + `HTTPServer` is now a subclass of `tornado.util.Configurable`. """ def __init__(self, *args, **kwargs): # Ignore args to __init__; real initialization belongs in diff --git a/tornado/simple_httpclient.py b/tornado/simple_httpclient.py index 0319ff440..cf58e1626 100644 --- a/tornado/simple_httpclient.py +++ b/tornado/simple_httpclient.py @@ -50,9 +50,6 @@ class SimpleAsyncHTTPClient(AsyncHTTPClient): """Non-blocking HTTP client with no external dependencies. This class implements an HTTP 1.1 client on top of Tornado's IOStreams. - It does not currently implement all applicable parts of the HTTP - specification, but it does enough to work with major web service APIs. - Some features found in the curl-based AsyncHTTPClient are not yet supported. In particular, proxies are not supported, connections are not reused, and callers cannot select the network interface to be @@ -66,20 +63,33 @@ class SimpleAsyncHTTPClient(AsyncHTTPClient): Only a single AsyncHTTPClient instance exists per IOLoop in order to provide limitations on the number of pending connections. - force_instance=True may be used to suppress this behavior. + ``force_instance=True`` may be used to suppress this behavior. + + Note that because of this implicit reuse, unless ``force_instance`` + is used, only the first call to the constructor actually uses + its arguments. It is recommended to use the ``configure`` method + instead of the constructor to ensure that arguments take effect. - max_clients is the number of concurrent requests that can be - in progress. Note that this arguments are only used when the - client is first created, and will be ignored when an existing - client is reused. + ``max_clients`` is the number of concurrent requests that can be + in progress; when this limit is reached additional requests will be + queued. Note that time spent waiting in this queue still counts + against the ``request_timeout``. - hostname_mapping is a dictionary mapping hostnames to IP addresses. + ``hostname_mapping`` is a dictionary mapping hostnames to IP addresses. It can be used to make local DNS changes when modifying system-wide - settings like /etc/hosts is not possible or desirable (e.g. in + settings like ``/etc/hosts`` is not possible or desirable (e.g. in unittests). - max_buffer_size is the number of bytes that can be read by IOStream. It - defaults to 100mb. + ``max_buffer_size`` (default 100MB) is the number of bytes + that can be read into memory at once. ``max_body_size`` + (defaults to ``max_buffer_size``) is the largest response body + that the client will accept. Without a + ``streaming_callback``, the smaller of these two limits + applies; with a ``streaming_callback`` only ``max_body_size`` + does. + + .. versionchanged:: 4.2 + Added the ``max_body_size`` argument. """ super(SimpleAsyncHTTPClient, self).initialize(io_loop, defaults=defaults)