ResolvedAddress
- The type of address after resolution.public interface HttpLoadBalancerFactory<ResolvedAddress> extends LoadBalancerFactory<ResolvedAddress,FilterableStreamingHttpLoadBalancedConnection>
LoadBalancerFactory
for HTTP clients.Modifier and Type | Method and Description |
---|---|
<T extends FilterableStreamingHttpLoadBalancedConnection> |
newLoadBalancer(Publisher<? extends ServiceDiscovererEvent<ResolvedAddress>> eventPublisher,
ConnectionFactory<ResolvedAddress,T> cf)
Create a new
LoadBalancer . |
FilterableStreamingHttpLoadBalancedConnection |
toLoadBalancedConnection(FilterableStreamingHttpConnection connection)
Converts the passed
FilterableStreamingHttpConnection to a
FilterableStreamingHttpLoadBalancedConnection . |
<T extends FilterableStreamingHttpLoadBalancedConnection> LoadBalancer<T> newLoadBalancer(Publisher<? extends ServiceDiscovererEvent<ResolvedAddress>> eventPublisher, ConnectionFactory<ResolvedAddress,T> cf)
LoadBalancerFactory
LoadBalancer
.newLoadBalancer
in interface LoadBalancerFactory<ResolvedAddress,FilterableStreamingHttpLoadBalancedConnection>
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
.cf
- 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
.FilterableStreamingHttpLoadBalancedConnection toLoadBalancedConnection(FilterableStreamingHttpConnection connection)
FilterableStreamingHttpConnection
to a
FilterableStreamingHttpLoadBalancedConnection
.connection
- FilterableStreamingHttpConnection
to convert.FilterableStreamingHttpLoadBalancedConnection
for the passed
FilterableStreamingHttpConnection
.