ResolvedAddress
- The resolved address type.C
- The type of connection.public static final class RoundRobinLoadBalancer.RoundRobinLoadBalancerFactory<ResolvedAddress,C extends LoadBalancedConnection> extends java.lang.Object implements LoadBalancerFactory<ResolvedAddress,C>
Constructor and Description |
---|
RoundRobinLoadBalancerFactory() |
Modifier and Type | Method and Description |
---|---|
<T extends C> |
newLoadBalancer(Publisher<? extends ServiceDiscovererEvent<ResolvedAddress>> eventPublisher,
ConnectionFactory<ResolvedAddress,T> connectionFactory)
Create a new
LoadBalancer . |
public <T extends C> LoadBalancer<T> newLoadBalancer(Publisher<? extends ServiceDiscovererEvent<ResolvedAddress>> eventPublisher, ConnectionFactory<ResolvedAddress,T> connectionFactory)
LoadBalancerFactory
LoadBalancer
.newLoadBalancer
in interface LoadBalancerFactory<ResolvedAddress,C extends LoadBalancedConnection>
T
- Type of connections created by the passed ConnectionFactory
.eventPublisher
- A stream of ServiceDiscovererEvent
s which the LoadBalancer
can use to
connect to physical hosts. Typically generated from a ServiceDiscoverer
.connectionFactory
- ConnectionFactory
that the returned LoadBalancer
will use to generate
new connections. Returned LoadBalancer
will own the responsibility for this ConnectionFactory
and hence will call AsyncCloseable.closeAsync()
when AsyncCloseable.closeAsync()
is called.LoadBalancer
.