class_docstr: An non-blocking HTTP client.
  
  Example usage::
  
      def handle_response(response):
          if response.error:
              print("Error: %s" % response.error)
          else:
              print(response.body)
  
      http_client = AsyncHTTPClient()
      http_client.fetch("http://www.google.com/", handle_response)
  
  The constructor for this class is magic in several respects: It
  actually creates an instance of an implementation-specific
  subclass, and instances are reused as a kind of pseudo-singleton
  (one per `.IOLoop`).  The keyword argument ``force_instance=True``
  can be used to suppress this singleton behavior.  Unless
  ``force_instance=True`` is used, no arguments other than
  ``io_loop`` should be passed to the `AsyncHTTPClient` constructor.
  The implementation subclass as well as arguments to its
  constructor can be set with the static method `configure()`
  
  All `AsyncHTTPClient` implementations support a ``defaults``
  keyword argument, which can be used to set default values for
  `HTTPRequest` attributes.  For example::
  
      AsyncHTTPClient.configure(
          None, defaults=dict(user_agent="MyUserAgent"))
      # or with force_instance:
      client = AsyncHTTPClient(force_instance=True,
          defaults=dict(user_agent="MyUserAgent"))
  
  .. versionchanged:: 4.1
     The ``io_loop`` argument is deprecated.
class_docstr_tok: ["An","non-blocking","HTTP","client",".","Example","usage",":",":","def","handle_response","(","response",")",":","if","response.error",":","print","(","``","Error",":","%","s","''","%","response.error",")","else",":","print","(","response.body",")","http_client","=","AsyncHTTPClient","(",")","http_client.fetch","(","``","http",":","\/\/www.google.com\/","''",",","handle_response",")","The","constructor","for","this","class","is","magic","in","several","respects",":","It","actually","creates","an","instance","of","an","implementation-specific","subclass",",","and","instances","are","reused","as","a","kind","of","pseudo-singleton","(","one","per","`",".IOLoop","`",")",".","The","keyword","argument","``","force_instance=True","``","can","be","used","to","suppress","this","singleton","behavior",".","Unless","``","force_instance=True","``","is","used",",","no","arguments","other","than","``","io_loop","``","should","be","passed","to","the","`","AsyncHTTPClient","`","constructor",".","The","implementation","subclass","as","well","as","arguments","to","its","constructor","can","be","set","with","the","static","method","`","configure","(",")","`","All","`","AsyncHTTPClient","`","implementations","support","a","``","defaults","``","keyword","argument",",","which","can","be","used","to","set","default","values","for","`","HTTPRequest","`","attributes",".","For","example",":",":","AsyncHTTPClient.configure","(","None",",","defaults=dict","(","user_agent=","''","MyUserAgent","''",")",")","#","or","with","force_instance",":","client","=","AsyncHTTPClient","(","force_instance=True",",","defaults=dict","(","user_agent=","''","MyUserAgent","''",")",")","..","versionchanged",":",":","4.1","The","``","io_loop","``","argument","is","deprecated","."]
docstr: Configures the `AsyncHTTPClient` subclass to use.
  
  ``AsyncHTTPClient()`` actually creates an instance of a subclass.
  This method may be called with either a class object or the
  fully-qualified name of such a class (or ``None`` to use the default,
  ``SimpleAsyncHTTPClient``)
  
  If additional keyword arguments are given, they will be passed
  to the constructor of each subclass instance created.  The
  keyword argument ``max_clients`` determines the maximum number
  of simultaneous `~AsyncHTTPClient.fetch()` operations that can
  execute in parallel on each `.IOLoop`.  Additional arguments
  may be supported depending on the implementation class in use.
  
  Example::
  
     AsyncHTTPClient.configure("tornado.curl_httpclient.CurlAsyncHTTPClient")
code: def configure(cls, impl, **kwargs):
      """Configures the `AsyncHTTPClient` subclass to use.
  
      ``AsyncHTTPClient()`` actually creates an instance of a subclass.
      This method may be called with either a class object or the
      fully-qualified name of such a class (or ``None`` to use the default,
      ``SimpleAsyncHTTPClient``)
  
      If additional keyword arguments are given, they will be passed
      to the constructor of each subclass instance created.  The
      keyword argument ``max_clients`` determines the maximum number
      of simultaneous `~AsyncHTTPClient.fetch()` operations that can
      execute in parallel on each `.IOLoop`.  Additional arguments
      may be supported depending on the implementation class in use.
  
      Example::
  
         AsyncHTTPClient.configure("tornado.curl_httpclient.CurlAsyncHTTPClient")
      """
      super(AsyncHTTPClient, cls).configure(impl, **kwargs)
  
imports: from __future__ import absolute_import, division, print_function
  import functools
  import time
  import weakref
  from tornado.concurrent import TracebackFuture
  from tornado.escape import utf8, native_str
  from tornado import httputil, stack_context
  from tornado.ioloop import IOLoop
  from tornado.util import Configurable
label_desc: Use image node_id 9 for calling the AsyncHTTPClient obj's underlying member method code with example usage: obj.configure(cls, impl) without return types