本文整理匯總了Python中pip._vendor.urllib3.poolmanager.PoolManager方法的典型用法代碼示例。如果您正苦於以下問題:Python poolmanager.PoolManager方法的具體用法?Python poolmanager.PoolManager怎麽用?Python poolmanager.PoolManager使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類pip._vendor.urllib3.poolmanager
的用法示例。
在下文中一共展示了poolmanager.PoolManager方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: init_poolmanager
# 需要導入模塊: from pip._vendor.urllib3 import poolmanager [as 別名]
# 或者: from pip._vendor.urllib3.poolmanager import PoolManager [as 別名]
def init_poolmanager(self, connections, maxsize, block=DEFAULT_POOLBLOCK, **pool_kwargs):
"""Initializes a urllib3 PoolManager.
This method should not be called from user code, and is only
exposed for use when subclassing the
:class:`HTTPAdapter <requests.adapters.HTTPAdapter>`.
:param connections: The number of urllib3 connection pools to cache.
:param maxsize: The maximum number of connections to save in the pool.
:param block: Block when no free connections are available.
:param pool_kwargs: Extra keyword arguments used to initialize the Pool Manager.
"""
# save these values for pickling
self._pool_connections = connections
self._pool_maxsize = maxsize
self._pool_block = block
self.poolmanager = PoolManager(num_pools=connections, maxsize=maxsize,
block=block, strict=True, **pool_kwargs)