Is your feature request related to a problem? Please describe.
The SDK doesn't allow clients to configure the OkHttpClient instance used for network operations. This creates a serious performance drawback since each app should maintain a single OkHttpClient instance to share thread pools and connection pools. Multiple instances lead to increased memory usage and reduced efficiency.
Describe the solution you'd like
Add a mechanism for clients to supply their own OkHttpClient instance during SDK initialization. This would enable:
- Sharing a single
OkHttpClient across the entire application
- Reusing connection pools and thread pools
Describe alternatives you've considered
Exposing configuration options within the SDK would help but still results in multiple OkHttpClient instances if the client uses their own instance elsewhere, defeating the purpose of resource sharing.
Additional context
The OkHttp documentation recommends creating a single OkHttpClient instance and reusing it for all HTTP calls: "each client holds its own connection pool and thread pools. Reusing connections and threads reduces latency and saves memory."
This feature would align the SDK with best practices and allow developers to optimize their applications' network performance.
Is your feature request related to a problem? Please describe.
The SDK doesn't allow clients to configure the
OkHttpClientinstance used for network operations. This creates a serious performance drawback since each app should maintain a singleOkHttpClientinstance to share thread pools and connection pools. Multiple instances lead to increased memory usage and reduced efficiency.Describe the solution you'd like
Add a mechanism for clients to supply their own
OkHttpClientinstance during SDK initialization. This would enable:OkHttpClientacross the entire applicationDescribe alternatives you've considered
Exposing configuration options within the SDK would help but still results in multiple
OkHttpClientinstances if the client uses their own instance elsewhere, defeating the purpose of resource sharing.Additional context
The OkHttp documentation recommends creating a single
OkHttpClientinstance and reusing it for all HTTP calls: "each client holds its own connection pool and thread pools. Reusing connections and threads reduces latency and saves memory."This feature would align the SDK with best practices and allow developers to optimize their applications' network performance.