Range2 It is recommended to use this method to 'Range'
(cb func(string, ziface.IConnection, interface{}) error, args interface{})
| 112 | |
| 113 | // Range2 It is recommended to use this method to 'Range' |
| 114 | func (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 | } |
nothing calls this directly
no test coverage detected