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>
ALoadBalancerFactory
for 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
.FilterableStreamingHttpLoadBalancedConnection
toLoadBalancedConnection(FilterableStreamingHttpConnection connection)
Converts the passedFilterableStreamingHttpConnection
to aFilterableStreamingHttpLoadBalancedConnection
.
-
-
-
Method Detail
-
newLoadBalancer
<T extends FilterableStreamingHttpLoadBalancedConnection> LoadBalancer<T> newLoadBalancer(Publisher<? extends ServiceDiscovererEvent<ResolvedAddress>> eventPublisher, ConnectionFactory<ResolvedAddress,T> cf)
Description copied from interface:LoadBalancerFactory
Create a newLoadBalancer
.- Specified by:
newLoadBalancer
in interfaceLoadBalancerFactory<ResolvedAddress,FilterableStreamingHttpLoadBalancedConnection>
- 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
.cf
-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
.
-
toLoadBalancedConnection
FilterableStreamingHttpLoadBalancedConnection toLoadBalancedConnection(FilterableStreamingHttpConnection connection)
Converts the passedFilterableStreamingHttpConnection
to aFilterableStreamingHttpLoadBalancedConnection
.- Parameters:
connection
-FilterableStreamingHttpConnection
to convert.- Returns:
FilterableStreamingHttpLoadBalancedConnection
for the passedFilterableStreamingHttpConnection
.
-
-