def __http_pool(self):
"""
Create HTTP connection pool
:raise HttpRequestError
:return: urllib3.HTTPConnectionPool
"""
try:
pool = HTTPConnectionPool(self.__cfg.host,
port=self.__cfg.port,
maxsize=self.__cfg.threads,
timeout=Timeout(self.__cfg.timeout, read=self.__cfg.timeout),
block=True)
if self._HTTP_DBG_LEVEL <= self.__debug.level:
self.__debug.debug_connection_pool('http_pool_start', pool)
return pool
except Exception as error:
raise HttpRequestError(str(error))
评论列表
文章目录