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

Method Drain

internal/xds/server/conn_wrapper.go:139–147  ·  view source on GitHub ↗

Drain drains the associated ServerTransport, or sets draining to true so it will be drained after it is created.

()

Source from the content-addressed store, hash-verified

137// Drain drains the associated ServerTransport, or sets draining to true so it
138// will be drained after it is created.
139func (c *connWrapper) Drain() {
140 c.mu.Lock()
141 defer c.mu.Unlock()
142 if c.st == nil {
143 c.draining = true
144 } else {
145 c.st.Drain("draining")
146 }
147}
148
149// Close closes the providers and the underlying connection.
150func (c *connWrapper) Close() error {

Callers

nothing calls this directly

Calls 3

DrainMethod · 0.65
LockMethod · 0.45
UnlockMethod · 0.45

Tested by

no test coverage detected