Package io.servicetalk.loadbalancer
Class RoundRobinLoadBalancer.RoundRobinLoadBalancerFactory<ResolvedAddress,C extends LoadBalancedConnection>
- java.lang.Object
-
- io.servicetalk.loadbalancer.RoundRobinLoadBalancer.RoundRobinLoadBalancerFactory<ResolvedAddress,C>
-
- Type Parameters:
ResolvedAddress
- The resolved address type.C
- The type of connection.
- All Implemented Interfaces:
LoadBalancerFactory<ResolvedAddress,C>
- Enclosing class:
- RoundRobinLoadBalancer<ResolvedAddress,C extends LoadBalancedConnection>
public static final class RoundRobinLoadBalancer.RoundRobinLoadBalancerFactory<ResolvedAddress,C extends LoadBalancedConnection> extends java.lang.Object implements LoadBalancerFactory<ResolvedAddress,C>
-
-
Constructor Summary
Constructors Constructor Description RoundRobinLoadBalancerFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T extends C>
LoadBalancer<T>newLoadBalancer(Publisher<? extends ServiceDiscovererEvent<ResolvedAddress>> eventPublisher, ConnectionFactory<ResolvedAddress,T> connectionFactory)
Create a newLoadBalancer
.
-
-
-
Method Detail
-
newLoadBalancer
public <T extends C> LoadBalancer<T> newLoadBalancer(Publisher<? extends ServiceDiscovererEvent<ResolvedAddress>> eventPublisher, ConnectionFactory<ResolvedAddress,T> connectionFactory)
Description copied from interface:LoadBalancerFactory
Create a newLoadBalancer
.- Specified by:
newLoadBalancer
in interfaceLoadBalancerFactory<ResolvedAddress,C extends LoadBalancedConnection>
- Type Parameters:
T
- Type of connections created by the passedConnectionFactory
.- Parameters:
eventPublisher
- A stream ofServiceDiscovererEvent
s which theLoadBalancer
can use to connect to physical hosts. Typically generated from aServiceDiscoverer
.connectionFactory
-ConnectionFactory
that the returnedLoadBalancer
will use to generate new connections. ReturnedLoadBalancer
will own the responsibility for thisConnectionFactory
and hence will callAsyncCloseable.closeAsync()
whenAsyncCloseable.closeAsync()
is called.- Returns:
- a new
LoadBalancer
.
-
-