I have a HttpClientWrapper
, called CarInformationClient
public class CarInformationClient
{
private readonly HttpClient _httpClient;
public CarInformationClient(HttpClient httpClient)
{
_httpClient = httpClient;
}
public async Task<CarInfoResponse> GetCarInfoAsync(string customerReference)
{
var request = new CarInfoRequest
{
CustomerReference = customerReference
};
var response = await _//send data with httpclient
//do something with the response
}
}
And I am registering it as a singleton with Windsor
Component.For<HttpClient>().LifestyleSingleton()
As HttpClient
is supposed to be reused across calls to the same host, is this singleton implementationg going to slow things down if a large number of clients simulatenously call GetCarInfoAsync
as there is only ever one instance of HttpClient
? I have seen this question but it doesn't quite answer my question.