Package io.servicetalk.http.api
Interface HttpLoadBalancerFactory<ResolvedAddress>
-
- Type Parameters:
ResolvedAddress- The type of address after resolution.
- All Superinterfaces:
LoadBalancerFactory<ResolvedAddress,FilterableStreamingHttpLoadBalancedConnection>
- All Known Implementing Classes:
DefaultHttpLoadBalancerFactory
public interface HttpLoadBalancerFactory<ResolvedAddress> extends LoadBalancerFactory<ResolvedAddress,FilterableStreamingHttpLoadBalancedConnection>
ALoadBalancerFactoryfor HTTP clients.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <T extends FilterableStreamingHttpLoadBalancedConnection>
LoadBalancer<T>newLoadBalancer(Publisher<? extends ServiceDiscovererEvent<ResolvedAddress>> eventPublisher, ConnectionFactory<ResolvedAddress,T> cf)Create a newLoadBalancer.FilterableStreamingHttpLoadBalancedConnectiontoLoadBalancedConnection(FilterableStreamingHttpConnection connection)Converts the passedFilterableStreamingHttpConnectionto aFilterableStreamingHttpLoadBalancedConnection.
-
-
-
Method Detail
-
newLoadBalancer
<T extends FilterableStreamingHttpLoadBalancedConnection> LoadBalancer<T> newLoadBalancer(Publisher<? extends ServiceDiscovererEvent<ResolvedAddress>> eventPublisher, ConnectionFactory<ResolvedAddress,T> cf)
Description copied from interface:LoadBalancerFactoryCreate a newLoadBalancer.- Specified by:
newLoadBalancerin interfaceLoadBalancerFactory<ResolvedAddress,FilterableStreamingHttpLoadBalancedConnection>- Type Parameters:
T- Type of connections created by the passedConnectionFactory.- Parameters:
eventPublisher- A stream ofServiceDiscovererEvents which theLoadBalancercan use to connect to physical hosts. Typically generated from aServiceDiscoverer.cf-ConnectionFactorythat the returnedLoadBalancerwill use to generate new connections. ReturnedLoadBalancerwill own the responsibility for thisConnectionFactoryand hence will callAsyncCloseable.closeAsync()whenAsyncCloseable.closeAsync()is called.- Returns:
- a new
LoadBalancer.
-
toLoadBalancedConnection
FilterableStreamingHttpLoadBalancedConnection toLoadBalancedConnection(FilterableStreamingHttpConnection connection)
Converts the passedFilterableStreamingHttpConnectionto aFilterableStreamingHttpLoadBalancedConnection.- Parameters:
connection-FilterableStreamingHttpConnectionto convert.- Returns:
FilterableStreamingHttpLoadBalancedConnectionfor the passedFilterableStreamingHttpConnection.
-
-