Skip to content

Commit

Permalink
comments
Browse files Browse the repository at this point in the history
  • Loading branch information
arjan-bal committed Dec 11, 2024
1 parent b126155 commit cb0f4a6
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions balancer_wrapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -424,9 +424,9 @@ func (acbw *acBalancerWrapper) closeProducers() {
// for registering listeners.
type healthProducerRegisterFn = func(context.Context, balancer.SubConn, string, func(balancer.SubConnState)) func()

// healthServiceOpts returns the options for client side health checking.
// It returns a nil registerHealthListenerFn if client side health checks are
// disabled.
// healthServiceOpts returns the service name and a function to register
// listener for client side health checking. It returns a nil
// registerHealthListenerFn if client side health checks are disabled.
// Client side health checking is enabled when all the following
// conditions are satisfied:
// 1. Health checking is not disabled using the dial option.
Expand Down Expand Up @@ -483,6 +483,8 @@ func (acbw *acBalancerWrapper) RegisterHealthListener(listener func(balancer.Sub
if acbw.healthData != hd {
return
}
// If client side health checks are disabled, send the raw connectivity
// state and return.
if registerFn == nil {
listener(balancer.SubConnState{ConnectivityState: connectivity.Ready})
return
Expand Down

0 comments on commit cb0f4a6

Please sign in to comment.