MCPcopy Create free account
hub / github.com/dadgar/onecache / Shutdown

Method Shutdown

onecache/pool.go:148–163  ·  view source on GitHub ↗

Shutdown is used to close the connection pool

()

Source from the content-addressed store, hash-verified

146
147// Shutdown is used to close the connection pool
148func (p *connPool) Shutdown() error {
149 p.Lock()
150 defer p.Unlock()
151
152 for _, conn := range p.pool {
153 conn.Close()
154 }
155 p.pool = make(map[string]*conn)
156
157 if p.shutdown {
158 return nil
159 }
160 p.shutdown = true
161 close(p.shutdownCh)
162 return nil
163}
164
165// Acquire is used to get a connection that is pooled or to return a new
166// connection

Callers 3

ExitMethod · 0.80
shutdownMethod · 0.80
tearDownNodesFunction · 0.80

Calls 1

CloseMethod · 0.45

Tested by

no test coverage detected