class CurlAsyncHTTPClient(AsyncHTTPClient):
- def initialize(self, io_loop=None, max_clients=10,
- max_simultaneous_connections=None):
+ def initialize(self, io_loop=None, max_clients=10):
self.io_loop = io_loop
self._multi = pycurl.CurlMulti()
self._multi.setopt(pycurl.M_TIMERFUNCTION, self._set_timeout)
self._multi.setopt(pycurl.M_SOCKETFUNCTION, self._handle_socket)
- self._curls = [_curl_create(max_simultaneous_connections)
- for i in xrange(max_clients)]
+ self._curls = [_curl_create() for i in xrange(max_clients)]
self._free_list = self._curls[:]
self._requests = collections.deque()
self._fds = {}
self.errno = errno
-def _curl_create(max_simultaneous_connections=None):
+def _curl_create():
curl = pycurl.Curl()
if logging.getLogger().isEnabledFor(logging.DEBUG):
curl.setopt(pycurl.VERBOSE, 1)
curl.setopt(pycurl.DEBUGFUNCTION, _curl_debug)
- curl.setopt(pycurl.MAXCONNECTS, max_simultaneous_connections or 5)
return curl
"""
def initialize(self, io_loop=None, max_clients=10,
- max_simultaneous_connections=None,
hostname_mapping=None, max_buffer_size=104857600):
"""Creates a AsyncHTTPClient.
in order to provide limitations on the number of pending connections.
force_instance=True may be used to suppress this behavior.
- max_clients is the number of concurrent requests that can be in
- progress. max_simultaneous_connections has no effect and is accepted
- only for compatibility with the curl-based AsyncHTTPClient. Note
- that these 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. Note that this arguments are only used when the
+ client is first created, and will be ignored when an existing
+ client is reused.
hostname_mapping is a dictionary mapping hostnames to IP addresses.
It can be used to make local DNS changes when modifying system-wide