In http_client.py we have the following:
class SynchronousHttpClient(HttpClient):
"""Synchronous HTTP client implementation.
"""
def __init__(self):
self.session = requests.Session()
self.authenticator = None
self.websockets = set()
So every requests creates a new connection.
What if we add there connection pooling and caching? Something like this:
def __init__(self):
from requests.adapters import HTTPAdapter
self.session = requests.Session()
self.session.mount('http://', HTTPAdapter(pool_connections=50, pool_maxsize=100))
self.authenticator = None
self.websockets = set()
But we need a way to pass these parameters when we initialize ari client.
What do you think?