MCPcopy
hub / github.com/aceld/zinx / Range2

Method Range2

znet/connmanager.go:114–125  ·  view source on GitHub ↗

Range2 It is recommended to use this method to 'Range'

(cb func(string, ziface.IConnection, interface{}) error, args interface{})

Source from the content-addressed store, hash-verified

112
113// Range2 It is recommended to use this method to 'Range'
114func (connMgr *ConnManager) Range2(cb func(string, ziface.IConnection, interface{}) error, args interface{}) (err error) {
115
116 connMgr.connections.IterCb(func(key string, v interface{}) {
117 conn, _ := v.(ziface.IConnection)
118 err = cb(conn.GetConnIdStr(), conn, args)
119 if err != nil {
120 zlog.Ins().InfoF("Range2 key: %v, v: %v, error: %v", key, v, err)
121 }
122 })
123
124 return err
125}

Callers

nothing calls this directly

Calls 4

InsFunction · 0.92
IterCbMethod · 0.80
GetConnIdStrMethod · 0.65
InfoFMethod · 0.65

Tested by

no test coverage detected