Allow setting maxsize for PoolManager (#18)

* Allow setting maxsize for PoolManager

* Only customize maxsize if config is explicitly not set to None
This commit is contained in:
Yuvi Panda 2017-07-08 22:28:10 -07:00 committed by Mehdy Bohlool
parent 26cb526eaa
commit d301e200fb
2 changed files with 11 additions and 3 deletions

View File

@ -30,9 +30,7 @@ from six.moves import http_client as httplib
class ConfigurationObject(object):
"""
NOTE: This class is auto generated by the swagger code generator program.
Ref: https://github.com/swagger-api/swagger-codegen
Do not edit the class manually.
Configuration options for RESTClientObject
"""
def __init__(self):
@ -85,6 +83,13 @@ class ConfigurationObject(object):
# Set this to True/False to enable/disable SSL hostname verification.
self.assert_hostname = None
# urllib3 connection pool's maximum number of connections saved
# per pool. Increasing this is useful for cases when you are
# making a lot of possibly parallel requests to the same host,
# which is often the case here.
# When set to `None`, will default to whatever urllib3 uses
self.connection_pool_maxsize = None
@property
def logger_file(self):
"""

View File

@ -99,6 +99,9 @@ class RESTClientObject(object):
'key_file': key_file,
}
if config.connection_pool_maxsize is not None:
kwargs['maxsize'] = config.connection_pool_maxsize
if config.assert_hostname is not None:
kwargs['assert_hostname'] = config.assert_hostname