diff options
author | Joffrey F <joffrey@docker.com> | 2016-09-12 17:43:50 -0700 |
---|---|---|
committer | Joffrey F <joffrey@docker.com> | 2016-09-16 11:55:08 -0700 |
commit | 64fba723ddd1f186548a3a7f49ca952265ac1121 (patch) | |
tree | d5b0d43f1c83d38b2c0d41cb955a77eeb94a4b62 /docker/client.py | |
parent | 06b6a62faab560ce7f07084d63294261db8bbca8 (diff) | |
download | docker-py-1.10.3-release.tar.gz |
Number of pools in adapter is configurable1.10.3-release
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 |