MCPcopy Index your code
hub / github.com/CovenantSQL/CovenantSQL / Close

Method Close

rpc/pool.go:195–207  ·  view source on GitHub ↗

Close closes all FreeLists in the pool.

()

Source from the content-addressed store, hash-verified

193
194// Close closes all FreeLists in the pool.
195func (p *ClientPool) Close() error {
196 var errmsgs []string
197 p.nodeFreeLists.Range(func(k, v interface{}) bool {
198 if err := v.(*freelist).close(); err != nil {
199 errmsgs = append(errmsgs, err.Error())
200 }
201 return true
202 })
203 if len(errmsgs) > 0 {
204 return errors.Wrap(errors.New(strings.Join(errmsgs, ", ")), "close connection pool")
205 }
206 return nil
207}
208
209// Len returns the connection count in the pool.
210func (p *ClientPool) Len() (total int) {

Callers 2

BenchmarkRPCComponentsFunction · 0.95
TestRPCComponentsFunction · 0.95

Calls 3

ErrorMethod · 0.80
NewMethod · 0.65
closeMethod · 0.45

Tested by 2

BenchmarkRPCComponentsFunction · 0.76
TestRPCComponentsFunction · 0.76