close initiates async shutdown of the wrapper. cc.mu must be held when calling this function. To determine the wrapper has finished shutting down, the channel should block on ccb.serializer.Done() without cc.mu held.
()
| 153 | // calling this function. To determine the wrapper has finished shutting down, |
| 154 | // the channel should block on ccb.serializer.Done() without cc.mu held. |
| 155 | func (ccb *ccBalancerWrapper) close() { |
| 156 | ccb.mu.Lock() |
| 157 | ccb.closed = true |
| 158 | ccb.mu.Unlock() |
| 159 | channelz.Info(logger, ccb.cc.channelz, "ccBalancerWrapper: closing") |
| 160 | ccb.serializer.TrySchedule(func(context.Context) { |
| 161 | if ccb.balancer == nil { |
| 162 | return |
| 163 | } |
| 164 | ccb.balancer.Close() |
| 165 | ccb.balancer = nil |
| 166 | }) |
| 167 | ccb.serializerCancel() |
| 168 | } |
| 169 | |
| 170 | // exitIdle invokes the balancer's exitIdle method in the serializer. |
| 171 | func (ccb *ccBalancerWrapper) exitIdle() { |
no test coverage detected