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 in a second bu… #231

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dtayeh
Copy link
Contributor

@dtayeh dtayeh commented Nov 24, 2024

…ilder method of the client

Situation

Some users of the RAPID 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.BuilderExtension to maintain current behaviour
  • A new builder method that takes an okHttpClient as a configuration is added.
  • okHttpClient is added to the RAPID client configuration
  • Users can still configure timeouts on the default existing okhttp client

Testing

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

  • Configuring timeouts on RAPID 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 24, 2024 16:04
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.

1 participant