MCPcopy
hub / github.com/grpc/grpc-go / balancerWrapper

Struct balancerWrapper

internal/balancer/gracefulswitch/gracefulswitch.go:295–303  ·  view source on GitHub ↗

balancerWrapper wraps a balancer.Balancer, and overrides some Balancer methods to help cleanup SubConns created by the wrapped balancer. It implements the balancer.ClientConn interface and is passed down in that capacity to the wrapped balancer. It maintains a set of subConns created by the wrapped

Source from the content-addressed store, hash-verified

293// State updates from the wrapped balancer can result in invocation of the
294// graceful switch logic.
295type balancerWrapper struct {
296 balancer.ClientConn
297 balancer.Balancer
298 gsb *Balancer
299 builder balancer.Builder
300
301 lastState balancer.State
302 subconns map[balancer.SubConn]bool // subconns created by this balancer
303}
304
305// Close closes the underlying LB policy and shuts down the subconns it
306// created. bw must not be referenced via balancerCurrent or balancerPending in

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected