-
Notifications
You must be signed in to change notification settings - Fork 183
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Decouple multi-address and partitioned client builders from `HttpClie…
…ntBuildContext` (#2136) Motivation: `DefaultMultiAddressHttpClientBuilder` and `DefaultPartitionedHttpClientBuilder` use `DefaultSingleAddressHttpClientBuilder` as a template for underlying single-address clients. It was helpful before we introduced a `SingleAddressInitializer` in #1387. Before that, all builders had the same set of methods and it was nice to reuse the single-address builder instead of maintaining a similar state at higher level builders. Now, `SingleAddressInitializer` helps to avoid duplication between builders. We don't have to use `DefaultSingleAddressHttpClientBuilder` as a template and can simplify its state by using a factory for `SingleAddressHttpClientBuilder`. Modifications: - `DefaultMultiAddressUrlHttpClientBuilder` and `DefaultPartitionedHttpClientBuilder` use a factory for `SingleAddressHttpClientBuilder` instead of `DefaultSingleAddressHttpClientBuilder` as a template and `HttpExecutionContextBuilder` for context-related items; - Remove and hide methods from `DefaultSingleAddressHttpClientBuilder` that are not used by other builders anymore; - Add a test to verify `DefaultMultiAddressUrlHttpClientBuilder` sets execution context items for underlying single-address builders; Result: `DefaultSingleAddressHttpClientBuilder` has less pkg-private API, `DefaultMultiAddressUrlHttpClientBuilder` and `DefaultPartitionedHttpClientBuilder` create a new single-address builder on demand, similar to grpc builders.
- Loading branch information
1 parent
310f6b5
commit a93fc9b
Showing
8 changed files
with
251 additions
and
271 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.