You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current implementation creates a new HttpClient instance with every new request. This is inefficient as it will:
Need to spin up a new Executor each time it runs for running the HTTP request in the background.
Cannot keep connections alive between requests.
To avoid HttpClient instances consuming resources longer than intended, I would propose a case class be introduced to manage an HttpClient with the client-specific parameters. A new overload of the existing request functions can be introduced that provides the client rather than the client-specific parameters (e.g. proxy, connect timeout), while the existing overloads can create a client instance on the fly as it does today. Users of the library could then opt into keeping longer-lived clients, while existing calls should behave the same as before.
The text was updated successfully, but these errors were encountered:
The current implementation creates a new
HttpClient
instance with every new request. This is inefficient as it will:To avoid
HttpClient
instances consuming resources longer than intended, I would propose a case class be introduced to manage anHttpClient
with the client-specific parameters. A new overload of the existing request functions can be introduced that provides the client rather than the client-specific parameters (e.g. proxy, connect timeout), while the existing overloads can create a client instance on the fly as it does today. Users of the library could then opt into keeping longer-lived clients, while existing calls should behave the same as before.The text was updated successfully, but these errors were encountered: