Currently, ClientFactory.GetClient() accepts an HttpClient instance as a parameter. This can lead to HttpClient lifetime issues when using dependency injection, as the IRpcClient may hold onto the HttpClient reference.
When registering IRpcClient as Singleton with a provided HttpClient, the HttpClient lives forever
When registering as Scoped/Transient, we lose connection pooling benefits
Consider accepting IHttpClientFactory instead of HttpClient, or provide an overload that accepts it. This would allow proper integration with .NET's dependency injection while maintaining optimal HttpClient lifecycle management.
https://learn.microsoft.com/en-us/dotnet/core/extensions/httpclient-factory
This would enable clean DI registration without worrying about HttpClient disposal.