Package io.servicetalk.http.api
Class DelegatingPartitionedHttpClientBuilder<U,R>
java.lang.Object
io.servicetalk.http.api.DelegatingPartitionedHttpClientBuilder<U,R>
- Type Parameters:
U
- the type of address before resolution (unresolved address)R
- the type of address after resolution (resolved address)
- All Implemented Interfaces:
PartitionedHttpClientBuilder<U,
R>
public class DelegatingPartitionedHttpClientBuilder<U,R>
extends Object
implements PartitionedHttpClientBuilder<U,R>
A
PartitionedHttpClientBuilder
that delegates all methods to another PartitionedHttpClientBuilder
.-
Nested Class Summary
Nested classes/interfaces inherited from interface io.servicetalk.http.api.PartitionedHttpClientBuilder
PartitionedHttpClientBuilder.SingleAddressInitializer<U,
R> -
Constructor Summary
ConstructorsConstructorDescriptionCreate a new instance. -
Method Summary
Modifier and TypeMethodDescriptionbufferAllocator
(BufferAllocator allocator) build()
protected final PartitionedHttpClientBuilder<U,
R> delegate()
Returns thePartitionedHttpClientBuilder
delegate.executionStrategy
(HttpExecutionStrategy strategy) headersFactory
(HttpHeadersFactory headersFactory) Sets theHttpHeadersFactory
to be used for creatingHttpHeaders
for new requests.initializer
(PartitionedHttpClientBuilder.SingleAddressInitializer<U, R> initializer) Set a function which can customize options for eachStreamingHttpClient
that is built.ioExecutor
(IoExecutor ioExecutor) partitionMapFactory
(PartitionMapFactory partitionMapFactory) SetsPartitionMapFactory
to use by allStreamingHttpClient
s created by this builder.retryServiceDiscoveryErrors
(BiIntFunction<Throwable, ? extends Completable> retryStrategy) Sets a retry strategy to retry errors emitted byServiceDiscoverer
.serviceDiscoverer
(ServiceDiscoverer<U, R, PartitionedServiceDiscovererEvent<R>> serviceDiscoverer) Sets aServiceDiscoverer
to resolve addresses of remote servers to connect to.serviceDiscoveryMaxQueueSize
(int serviceDiscoveryMaxQueueSize) Sets the maximum amount ofServiceDiscovererEvent
objects that will be queued for each partition.toString()
-
Constructor Details
-
DelegatingPartitionedHttpClientBuilder
Create a new instance.- Parameters:
delegate
-PartitionedHttpClientBuilder
to which all methods are delegated.
-
-
Method Details
-
delegate
Returns thePartitionedHttpClientBuilder
delegate.- Returns:
- Delegate
PartitionedHttpClientBuilder
.
-
toString
-
ioExecutor
- Specified by:
ioExecutor
in interfacePartitionedHttpClientBuilder<U,
R>
-
executor
- Specified by:
executor
in interfacePartitionedHttpClientBuilder<U,
R>
-
executionStrategy
- Specified by:
executionStrategy
in interfacePartitionedHttpClientBuilder<U,
R>
-
bufferAllocator
- Specified by:
bufferAllocator
in interfacePartitionedHttpClientBuilder<U,
R>
-
headersFactory
Description copied from interface:PartitionedHttpClientBuilder
Sets theHttpHeadersFactory
to be used for creatingHttpHeaders
for new requests.- Specified by:
headersFactory
in interfacePartitionedHttpClientBuilder<U,
R> - Parameters:
headersFactory
-HttpHeadersFactory
to be used for creatingHttpHeaders
for new requests- Returns:
this
-
serviceDiscoverer
public PartitionedHttpClientBuilder<U,R> serviceDiscoverer(ServiceDiscoverer<U, R, PartitionedServiceDiscovererEvent<R>> serviceDiscoverer) Description copied from interface:PartitionedHttpClientBuilder
Sets aServiceDiscoverer
to resolve addresses of remote servers to connect to.- Specified by:
serviceDiscoverer
in interfacePartitionedHttpClientBuilder<U,
R> - Parameters:
serviceDiscoverer
- TheServiceDiscoverer
to resolve addresses of remote servers to connect to. Lifecycle of the providedServiceDiscoverer
is managed externally and it should beclosed
after all builtStreamingHttpClient
s will be closed and thisServiceDiscoverer
is no longer needed.- Returns:
this
.
-
retryServiceDiscoveryErrors
public PartitionedHttpClientBuilder<U,R> retryServiceDiscoveryErrors(BiIntFunction<Throwable, ? extends Completable> retryStrategy) Description copied from interface:PartitionedHttpClientBuilder
Sets a retry strategy to retry errors emitted byServiceDiscoverer
.- Specified by:
retryServiceDiscoveryErrors
in interfacePartitionedHttpClientBuilder<U,
R> - Parameters:
retryStrategy
- a retry strategy to retry errors emitted byServiceDiscoverer
.- Returns:
this
.- See Also:
-
serviceDiscoveryMaxQueueSize
public PartitionedHttpClientBuilder<U,R> serviceDiscoveryMaxQueueSize(int serviceDiscoveryMaxQueueSize) Description copied from interface:PartitionedHttpClientBuilder
Sets the maximum amount ofServiceDiscovererEvent
objects that will be queued for each partition.It is assumed that the
PublisherSource.Subscriber
s will process events in a timely manner (typically synchronously) so this typically doesn't need to be very large.- Specified by:
serviceDiscoveryMaxQueueSize
in interfacePartitionedHttpClientBuilder<U,
R> - Parameters:
serviceDiscoveryMaxQueueSize
- the maximum amount ofServiceDiscovererEvent
objects that will be queued for each partition.- Returns:
this
.
-
partitionMapFactory
public PartitionedHttpClientBuilder<U,R> partitionMapFactory(PartitionMapFactory partitionMapFactory) Description copied from interface:PartitionedHttpClientBuilder
SetsPartitionMapFactory
to use by allStreamingHttpClient
s created by this builder.- Specified by:
partitionMapFactory
in interfacePartitionedHttpClientBuilder<U,
R> - Parameters:
partitionMapFactory
-PartitionMapFactory
to use.- Returns:
this
.
-
initializer
public PartitionedHttpClientBuilder<U,R> initializer(PartitionedHttpClientBuilder.SingleAddressInitializer<U, R> initializer) Description copied from interface:PartitionedHttpClientBuilder
Set a function which can customize options for eachStreamingHttpClient
that is built.- Specified by:
initializer
in interfacePartitionedHttpClientBuilder<U,
R> - Parameters:
initializer
- Initializes theSingleAddressHttpClientBuilder
used to build newStreamingHttpClient
s.- Returns:
this
-
build
-
buildStreaming
-
buildBlocking
-
buildBlockingStreaming
-