Package io.servicetalk.loadbalancer
Interface LoadBalancerObserver
public interface LoadBalancerObserver
An observer that provides visibility into a
LoadBalancer
.-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
An observer forHost
events. -
Method Summary
Modifier and TypeMethodDescriptionhostObserver
(Object resolvedAddress) void
onNoActiveHostsAvailable
(int hostSetSize, NoActiveHostException exception) Callback for when connection selection fails due to all hosts being inactive.void
Callback for when connection selection fails due to no hosts being available.void
onServiceDiscoveryEvent
(Collection<? extends ServiceDiscovererEvent<?>> events, int oldHostSetSize, int newHostSetSize) Callback for monitoring the changes due to a service discovery update.
-
Method Details
-
hostObserver
- Parameters:
resolvedAddress
- the resolved address of the host.- Returns:
- a
LoadBalancerObserver.HostObserver
.
-
onNoHostsAvailable
void onNoHostsAvailable()Callback for when connection selection fails due to no hosts being available. -
onServiceDiscoveryEvent
void onServiceDiscoveryEvent(Collection<? extends ServiceDiscovererEvent<?>> events, int oldHostSetSize, int newHostSetSize) Callback for monitoring the changes due to a service discovery update.- Parameters:
events
- the collection ofServiceDiscovererEvent
s received by the load balancer.oldHostSetSize
- the size of the previous host set.newHostSetSize
- the new size of the host set.
-
onNoActiveHostsAvailable
Callback for when connection selection fails due to all hosts being inactive.- Parameters:
hostSetSize
- the size of the current host set.exception
- an exception with more details about the failure.
-