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 HttpClient should be created with the IHttpClientFactory on every request, as the HttpClient is not thread safe. It disposes itself and therefor the BaseApi class cannot be longlived
The text was updated successfully, but these errors were encountered:
The HueApi is only creating 1 HttpClient, that gets reused for every request. It's not making a new HttpClient for every request, so there shouldn't be any issue.
HttpClient does not dispose of itself, as long as you keep the LocalHueApi alive, you keep reusing the same HttpClient. It's not recommended to create new LocalHueApi instances every time. Please reuse a single instance.
If you want more control, it's also possible to provide your own HttpClient to the LocalHueApi constructor, in that case you are responsible for providing a HttpClient, and you can get that HttpClient from a IHttpClientFactory in your own code.
Let me know if you have a specific usecase where the current setup causes an issue.
The HttpClient should be created with the IHttpClientFactory on every request, as the HttpClient is not thread safe. It disposes itself and therefor the BaseApi class cannot be longlived
The text was updated successfully, but these errors were encountered: