Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: SDK-1568 expose okhttp client as a configuration for XAP sdk #33

Merged
merged 6 commits into from
Nov 26, 2024

Conversation

dtayeh
Copy link
Contributor

@dtayeh dtayeh commented Nov 26, 2024

Situation

Some users of the SDK are interested in getting more control over the underlying httpClient used by the SDK, such as tuning the dispatcher concurrency configs, or injecting interceptors/eventlisteners for monitoring purposes

Task

Enable users to inject their own okhttp client when configuring the SDK client.

Action

  • Client builder is modified into two builders, one with the shared configs, and another one extended with the timeouts configs.
  • All existing base clients extend the Client.ConfigurableHttpBuilder to maintain current behaviour
  • A new builder method that takes an okHttpClient as a configuration is added.
  • Users can still configure timeouts on the default existing okhttp client

Testing

Manual testing by running the XAP examples covering test-cases:

  • Configuring timeouts on XAP client
  • Configuring a custom okHttpClient, user is unable to configure timeouts outside the httpclient.
  • Configuring a client with the existing builder, users are able to set timeouts.

Results

Users are able to build and inject a custom okhttp client to be used by the SDK for executing requests.

@dtayeh dtayeh requested a review from a team as a code owner November 26, 2024 11:19
anssari1
anssari1 previously approved these changes Nov 26, 2024
@anssari1 anssari1 merged commit 47e4848 into main Nov 26, 2024
1 check passed
@anssari1 anssari1 deleted the dtayeh/SDK-1568 branch November 26, 2024 16:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants