U - the type of address before resolution (unresolved address)R - the type of address after resolution (resolved address)public class DelegatingGrpcClientBuilder<U,R> extends Object implements GrpcClientBuilder<U,R>
GrpcClientBuilder that delegates all methods to another GrpcClientBuilder.GrpcClientBuilder.HttpInitializer<U,R>, GrpcClientBuilder.MultiClientBuilder| Constructor and Description |
|---|
DelegatingGrpcClientBuilder(GrpcClientBuilder<U,R> delegate) |
| 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.
|
GrpcClientBuilder<U,R> |
defaultTimeout(Duration defaultTimeout,
boolean appendTimeoutFilter)
Set default timeout during which gRPC calls are expected to complete.
|
protected GrpcClientBuilder<U,R> |
delegate()
Returns the
GrpcClientBuilder delegate. |
GrpcClientBuilder<U,R> |
initializeHttp(GrpcClientBuilder.HttpInitializer<U,R> initializer)
Set a function which can configure the underlying
SingleAddressHttpClientBuilder used for
the transport layer. |
String |
toString() |
public DelegatingGrpcClientBuilder(GrpcClientBuilder<U,R> delegate)
protected final GrpcClientBuilder<U,R> delegate()
GrpcClientBuilder delegate.GrpcClientBuilder.public String toString()
toString in class Objectpublic GrpcClientBuilder<U,R> initializeHttp(GrpcClientBuilder.HttpInitializer<U,R> initializer)
GrpcClientBuilderSingleAddressHttpClientBuilder used for
the transport layer.initializeHttp in interface GrpcClientBuilder<U,R>initializer - Initializes the underlying HTTP transport builder.this.public GrpcClientBuilder<U,R> defaultTimeout(Duration defaultTimeout)
GrpcClientBuilderdefaultTimeout in interface GrpcClientBuilder<U,R>defaultTimeout - Duration of default timeout which must be positive non-zero.this.GrpcClientBuilder.defaultTimeout(Duration, boolean)public GrpcClientBuilder<U,R> defaultTimeout(@Nullable Duration defaultTimeout, boolean appendTimeoutFilter)
GrpcClientBuilderdefaultTimeout in interface GrpcClientBuilder<U,R>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 GrpcClientBuilder.initializeHttp(io.servicetalk.grpc.api.GrpcClientBuilder.HttpInitializer<U, R>) and
SingleAddressHttpClientBuilder.appendClientFilter(StreamingHttpClientFilterFactory).this.GrpcFilters.newGrpcDeadlineClientFilterFactory()public <Client extends GrpcClient<?>> Client build(GrpcClientFactory<Client,?> clientFactory)
GrpcClientBuilderbuild in interface GrpcClientBuilder<U,R>Client - gRPC service that any client built from
this factory represents.clientFactory - GrpcClientFactory to use.public <BlockingClient extends BlockingGrpcClient<?>> BlockingClient buildBlocking(GrpcClientFactory<?,BlockingClient> clientFactory)
GrpcClientBuilderbuildBlocking in interface GrpcClientBuilder<U,R>BlockingClient - Blocking gRPC service that any
client built from this builder represents.clientFactory - GrpcClientFactory to use.public GrpcClientBuilder.MultiClientBuilder buildMulti()
GrpcClientBuilderGrpcClientBuilder.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.buildMulti in interface GrpcClientBuilder<U,R>builder that allows reusing underlying transport between
gRPC clients.