U - the type of address before resolution (unresolved address)R - the type of address after resolution (resolved address)public interface GrpcClientBuilder<U,R>
| Modifier and Type | Interface and Description |
|---|---|
static interface |
GrpcClientBuilder.HttpInitializer<U,R>
Initializes the underlying
SingleAddressHttpClientBuilder used for the transport layer. |
static interface |
GrpcClientBuilder.MultiClientBuilder
An interface to create multiple gRPC clients that share the underlying
transport.
|
| Modifier and Type | Method and Description |
|---|---|
<Client extends GrpcClient<?>> |
build(GrpcClientFactory<Client,?> clientFactory)
Builds a gRPC client.
|
<BlockingClient extends BlockingGrpcClient<?>> |
buildBlocking(GrpcClientFactory<?,BlockingClient> clientFactory)
Builds a blocking gRPC client.
|
GrpcClientBuilder.MultiClientBuilder |
buildMulti()
Returns a
GrpcClientBuilder.MultiClientBuilder to be used to create multiple clients that share the underlying transport. |
GrpcClientBuilder<U,R> |
defaultTimeout(Duration defaultTimeout)
Set default timeout during which gRPC calls are expected to complete.
|
default GrpcClientBuilder<U,R> |
defaultTimeout(Duration defaultTimeout,
boolean appendTimeoutFilter)
Set default timeout during which gRPC calls are expected to complete.
|
GrpcClientBuilder<U,R> |
initializeHttp(GrpcClientBuilder.HttpInitializer<U,R> initializer)
Set a function which can configure the underlying
SingleAddressHttpClientBuilder used for
the transport layer. |
GrpcClientBuilder<U,R> initializeHttp(GrpcClientBuilder.HttpInitializer<U,R> initializer)
SingleAddressHttpClientBuilder used for
the transport layer.initializer - Initializes the underlying HTTP transport builder.this.GrpcClientBuilder<U,R> defaultTimeout(Duration defaultTimeout)
defaultTimeout - Duration of default timeout which must be positive non-zero.this.defaultTimeout(Duration, boolean)default GrpcClientBuilder<U,R> defaultTimeout(@Nullable Duration defaultTimeout, boolean appendTimeoutFilter)
defaultTimeout - Duration of default timeout which must be positive non-zero, or null if a
default shouldn't be applied.appendTimeoutFilter - true to append the filter that enforces
deadline propagation. false to not append the filter and
therefore not enforce deadlines. If false you can manually insert
GrpcFilters.newGrpcDeadlineClientFilterFactory() in your preferred order use initializeHttp(io.servicetalk.grpc.api.GrpcClientBuilder.HttpInitializer<U, R>) and
SingleAddressHttpClientBuilder.appendClientFilter(StreamingHttpClientFilterFactory).this.GrpcFilters.newGrpcDeadlineClientFilterFactory()<Client extends GrpcClient<?>> Client build(GrpcClientFactory<Client,?> clientFactory)
Client - gRPC service that any client built from
this factory represents.clientFactory - GrpcClientFactory to use.<BlockingClient extends BlockingGrpcClient<?>> BlockingClient buildBlocking(GrpcClientFactory<?,BlockingClient> clientFactory)
BlockingClient - Blocking gRPC service that any
client built from this builder represents.clientFactory - GrpcClientFactory to use.GrpcClientBuilder.MultiClientBuilder buildMulti()
GrpcClientBuilder.MultiClientBuilder to be used to create multiple clients that share the underlying transport.
It is meant for a single backend that hosts different service APIs.