diff options
author | Joffrey F <joffrey@docker.com> | 2016-09-12 17:43:50 -0700 |
---|---|---|
committer | Joffrey F <joffrey@docker.com> | 2016-09-12 17:43:50 -0700 |
commit | be7d0f01844d5c08ee157446ce96f5bc6381507c (patch) | |
tree | 7954e3ae1241b4fe5ffbe3e0908d4fb89c969a17 /docker/client.py | |
parent | 72e7afe17a9aa8b002a726377ce86cc9e13f6f35 (diff) | |
download | docker-py-be7d0f01844d5c08ee157446ce96f5bc6381507c.tar.gz |
Number of pools in adapter is configurable1207-configurable-num-pools
Default increased from 10 to 25
Signed-off-by: Joffrey F <joffrey@docker.com>
Diffstat (limited to 'docker/client.py')
-rw-r--r-- | docker/client.py | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/docker/client.py b/docker/client.py index 6e8b278..47ad09e 100644 --- a/docker/client.py +++ b/docker/client.py @@ -40,7 +40,8 @@ class Client( api.VolumeApiMixin): def __init__(self, base_url=None, version=None, timeout=constants.DEFAULT_TIMEOUT_SECONDS, tls=False, - user_agent=constants.DEFAULT_USER_AGENT): + user_agent=constants.DEFAULT_USER_AGENT, + num_pools=constants.DEFAULT_NUM_POOLS): super(Client, self).__init__() if tls and not base_url: @@ -58,7 +59,9 @@ class Client( base_url, constants.IS_WINDOWS_PLATFORM, tls=bool(tls) ) if base_url.startswith('http+unix://'): - self._custom_adapter = UnixAdapter(base_url, timeout) + self._custom_adapter = UnixAdapter( + base_url, timeout, num_pools=num_pools + ) self.mount('http+docker://', self._custom_adapter) self._unmount('http://', 'https://') self.base_url = 'http+docker://localunixsocket' @@ -68,7 +71,9 @@ class Client( 'The npipe:// protocol is only supported on Windows' ) try: - self._custom_adapter = NpipeAdapter(base_url, timeout) + self._custom_adapter = NpipeAdapter( + base_url, timeout, num_pools=num_pools + ) except NameError: raise errors.DockerException( 'Install pypiwin32 package to enable npipe:// support' @@ -80,7 +85,9 @@ class Client( if isinstance(tls, TLSConfig): tls.configure_client(self) elif tls: - self._custom_adapter = ssladapter.SSLAdapter() + self._custom_adapter = ssladapter.SSLAdapter( + num_pools=num_pools + ) self.mount('https://', self._custom_adapter) self.base_url = base_url |