* `.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.
* 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
`.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
"""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
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)