Skip to content
This repository was archived by the owner on Mar 13, 2022. It is now read-only.

Commit d301e20

Browse files
yuvipandambohlool
authored andcommitted
Allow setting maxsize for PoolManager (#18)
* Allow setting maxsize for PoolManager * Only customize maxsize if config is explicitly not set to None
1 parent 26cb526 commit d301e20

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

configuration.py

+8-3
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,7 @@
3030

3131
class ConfigurationObject(object):
3232
"""
33-
NOTE: This class is auto generated by the swagger code generator program.
34-
Ref: https://github.com/swagger-api/swagger-codegen
35-
Do not edit the class manually.
33+
Configuration options for RESTClientObject
3634
"""
3735

3836
def __init__(self):
@@ -85,6 +83,13 @@ def __init__(self):
8583
# Set this to True/False to enable/disable SSL hostname verification.
8684
self.assert_hostname = None
8785

86+
# urllib3 connection pool's maximum number of connections saved
87+
# per pool. Increasing this is useful for cases when you are
88+
# making a lot of possibly parallel requests to the same host,
89+
# which is often the case here.
90+
# When set to `None`, will default to whatever urllib3 uses
91+
self.connection_pool_maxsize = None
92+
8893
@property
8994
def logger_file(self):
9095
"""

rest.py

+3
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,9 @@ def __init__(self, pools_size=4, config=configuration):
9999
'key_file': key_file,
100100
}
101101

102+
if config.connection_pool_maxsize is not None:
103+
kwargs['maxsize'] = config.connection_pool_maxsize
104+
102105
if config.assert_hostname is not None:
103106
kwargs['assert_hostname'] = config.assert_hostname
104107

0 commit comments

Comments
 (0)