B
- The type of builder that should be returned by the fluent builder methods in this interface.C
- The type of client generated by this builder.public interface SdkAsyncClientBuilder<B extends SdkAsyncClientBuilder<B,C>,C>
Implementations of this interface are mutable and not thread-safe.
Modifier and Type | Method and Description |
---|---|
B |
asyncConfiguration(ClientAsyncConfiguration clientAsyncConfiguration)
Specify overrides to the default SDK async configuration that should be used for clients created by this builder.
|
default B |
asyncConfiguration(Consumer<ClientAsyncConfiguration.Builder> clientAsyncConfiguration)
Similar to
asyncConfiguration(ClientAsyncConfiguration) , but takes a lambda to configure a new
ClientAsyncConfiguration.Builder . |
B |
httpClient(SdkAsyncHttpClient httpClient)
Sets the
SdkAsyncHttpClient that the SDK service client will use to make HTTP calls. |
B |
httpClientBuilder(SdkAsyncHttpClient.Builder httpClientBuilder)
Sets a custom HTTP client builder that will be used to obtain a configured instance of
SdkAsyncHttpClient . |
B asyncConfiguration(ClientAsyncConfiguration clientAsyncConfiguration)
default B asyncConfiguration(Consumer<ClientAsyncConfiguration.Builder> clientAsyncConfiguration)
asyncConfiguration(ClientAsyncConfiguration)
, but takes a lambda to configure a new
ClientAsyncConfiguration.Builder
. This removes the need to called ClientAsyncConfiguration.builder()
and ClientAsyncConfiguration.Builder#build()
.B httpClient(SdkAsyncHttpClient httpClient)
SdkAsyncHttpClient
that the SDK service client will use to make HTTP calls. This HTTP client may be
shared between multiple SDK service clients to share a common connection pool. To create a client you must use an
implementation specific builder. Note that this method is only recommended when you wish to share an HTTP client across
multiple SDK service clients. If you do not wish to share HTTP clients, it is recommended to use
httpClientBuilder(SdkAsyncHttpClient.Builder)
so that service specific default configuration may be applied.
This client must be closed by the caller when it is ready to be disposed. The SDK will not close the HTTP client when the service client is closed.
B httpClientBuilder(SdkAsyncHttpClient.Builder httpClientBuilder)
SdkAsyncHttpClient
. Any
service specific HTTP configuration will be merged with the builder's configuration prior to creating the client. When
there is no desire to share HTTP clients across multiple service clients, the client builder is the preferred way to
customize the HTTP client as it benefits from service specific defaults.
Clients created by the builder are managed by the SDK and will be closed when the service client is closed.
Copyright © 2021. All rights reserved.