C - The type of connection.public interface LoadBalancer<C extends LoadBalancedConnection> extends ListenableAsyncCloseable
SocketAddresses select the most desired SocketAddress to use. This is typically used
to determine which connection to issue a request to.| Modifier and Type | Method and Description |
|---|---|
Publisher<java.lang.Object> |
eventStream()
A
Publisher of events provided by this LoadBalancer. |
Single<C> |
selectConnection(java.util.function.Predicate<C> selector)
Select the most appropriate connection for a request.
|
onClosecloseAsync, closeAsyncGracefullySingle<C> selectConnection(java.util.function.Predicate<C> selector)
selector - A Function that evaluates a connection for selection.
This selector should return null if the connection MUST not be selected.
This selector is guaranteed to be called for any connection that is returned from this method.Single that completes with the most appropriate connection to use.Publisher<java.lang.Object> eventStream()
Publisher of events provided by this LoadBalancer. This maybe used to broadcast internal state
of this LoadBalancer to provide hints/visibility for external usage.Publisher of events provided by this LoadBalancer.